Back Reply to topic
Chaly 
(started thread)
Offizier · Webmaster 
Topics: 404
Posts: 2107
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * * * * * * *
!whois Posted: Post 11:24 Sun - Jun 22, 2008

Thx DjunA for ..er... "reminding" me about a !whois function

A !whois does the following:
- the bot adds someone to the his friendslist
- waiting for the server's response (including player doesn't exist)
- after getting the information, the bot prints the info and deletes the entry from his friendlist
as the bot has every guildmate on his friendslist too, there must be a check if a friend is a guildmate or a whois-entry.

i've quick-checked some of the guildmate functions and i've already done some minor changes:
-buddy plugin "guildbuddies" doesn't seem to have a problem with no-guildmate friends, but i've reduced the cpu & hdd activity
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.


Last edited by Chaly on 10:12 Mon - Jun 23, 2008; edited 2 times in total
Chaly 
(started thread)
Offizier · Webmaster 
Topics: 404
Posts: 2107
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * * * * * * *
Posted: Post 02:18 Sun - Jun 22, 2008

done. released in version 0.6 Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
kardson 
Topfight Chicken 
Topics: 6
Posts: 38
Playing:  AOC
Ingame:  kardson
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 01:48 Tue - Jun 24, 2008

Changed the !whois command sum.
I wanted it to return info on a !whois request when the person was a member of the guild. So far it works when they are online. Otherwise it just defaults to saying what level and class they are and that they are offline.. I would like it to state that they are in my guild and the last time of login,

What I changed the whois index.php to is

Code:

<?php
global $WhoIs;
if (!is_array($WhoIs)) {
   $WhoIs=array();
}

if ($pluginwords[1]=="!whois") {
   #second parameter?
   if ($pluginwords[2]) {
      if(preg_match('#^[a-z]+$#i',$pluginwords[2]) ) {
         global $guildmates;
         $whois=strtoupper(substr($pluginwords[2],0,1)).strtolower(substr($pluginwords[2],1));
         if (!$guildmates[$whois]) {
            global $BuddyList,$AOC;
            #remember the sender who did !whois for tell-replies..
            $WhoIs[$whois]=$sender;
            if (!$AOC->buddy_exists($whois)) {
               $AOC->buddy_add($whois);
               say("Doing a whois on $whois ($cid)",1);
               #i don't want to spamm two lines so this line is off:
               #$msg="Looking up $whois";
            } else {
               $cid=$AOC->lookup_user($whois);
               say("Found a non-guildmate-entry: $whois (removed)",1);
               $msg=$BuddyList[$cid]["name"].
                 " :: Level ".
                 $BuddyList[$cid]["level"]." ".
                 classname($BuddyList[$cid]["class"]).
                 " ::";
               if ($BuddyList[$cid]["status"]==0) $msg.=" is offline".$BuddyList[$cid]["laststatus"];
               if ($BuddyList[$cid]["status"]==1) $msg.=" is online";
               if ($BuddyList[$cid]["status"]==3) $msg.=" is online (AFK)";
               $AOC->buddy_remove($whois);
            }
         } else {
            global $BuddyList,$AOC;
            $cid=$AOC->lookup_user($whois);
               $msg=$BuddyList[$cid]["name"].
                 " is a Level ".
                 $BuddyList[$cid]["level"]." ".
                 classname($BuddyList[$cid]["class"]).
                 ", he is a guildmember and";
               if ($BuddyList[$cid]["status"]==0) $msg.=" offline";
               if ($BuddyList[$cid]["status"]==1) $msg.=" online in ".$BuddyList[$cid]["playfield"];
               if ($BuddyList[$cid]["status"]==3) $msg.=" online (AFK)";
         }
      } else {
         $msg="$sender :: ".$pluginwords[2]." is not a valid charactername!";
      }
   } else {
      $msg="Please use '!whois (name of the character)'.";
   }
   if ($msg) {
      #comment this line to suppress guild-output
      send_guild_channel_message(colortext(":: $msg ::"));
      #uncomment this line to send a tell
      #send_private_tell($sender,colortext(":: $msg ::"));
   }
}

?>


is there a way to pull the last time they were seen online?
so that it reads like

NAME is a level 31 CLASS who is offline and was last seen Sun Jun 22 19:04:53

per a Perl Script bot pbot I am looking at it. it was called like

"offline and was last seen " . localtime($state);

does the library give this ability?
any suggestions?
Reply with quote


kardson 
Topfight Chicken 
Topics: 6
Posts: 38
Playing:  AOC
Ingame:  kardson
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 08:00 Tue - Jun 24, 2008

Also.

The whois command doesn't recognize a person as a member of the guild if they are offline.

Is there a way to make it recognize offline guildmembers?
Reply with quote


Chaly 
(started thread)
Offizier · Webmaster 
Topics: 404
Posts: 2107
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * * * * * * *
Posted: Post 08:32 Tue - Jun 24, 2008

kardson wrote:
Also.
The whois command doesn't recognize a person as a member of the guild if they are offline.
Is there a way to make it recognize offline guildmembers?

Code:
 if (!$guildmates[$whois]) {

the bot checks if the person is a guildmate. it's just that there is no complete guildmemberlist available on the chatserver (just on the gameclient). the bot remembers anyone seen on the guildchannel.
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Chaly 
(started thread)
Offizier · Webmaster 
Topics: 404
Posts: 2107
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * * * * * * *
Posted: Post 08:40 Tue - Jun 24, 2008

Code:
per a Perl Script bot pbot I am looking at it. it was called like
"offline and was last seen " . localtime($state);

where $state is a variable the perlbot has to remember anytime he sees someone anywhere (on a public chat channel, tell, or on the buddylist). this could be done when the bot gets another plugin-type "namelookup" (packet 20), there's already a discussion about it at the gratz-plugin thread
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
kardson 
Topfight Chicken 
Topics: 6
Posts: 38
Playing:  AOC
Ingame:  kardson
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 10:51 Tue - Jun 24, 2008

Your right, I didn't realize the bot remembered names that it seen in guild chat.

It didn't seem to do that before, maybe when the bot crashes, it loses that info.. lachen it crashed alot while setting up the playfield addition lachen
Reply with quote


Back Reply to topic