collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Bebot /afk = logoff  (Read 3429 times)

0 Members and 1 Guest are viewing this topic.

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Bebot /afk = logoff
« on: July 09, 2008, 09:43:28 pm »
Whenever a guild member goes AFK the bot post's that the member has logged off.

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #1 on: July 09, 2008, 09:47:35 pm »
It is a "feature" in the chat server. Nothing I can do about it.

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #2 on: July 09, 2008, 10:07:15 pm »
Chat server should recognize the differance between a AFk and a logout.  The chat server differentiates between a logoff and a afk.  As the status change is different
I just need to know what that is called upon.

Example from ragebot
Code: [Select]
global $guildmates,$guildmains,$guildlookup;

/* Already loaded guildmates? If not we currently may logon and receive the status of every buddy */
if ($guildmates[0]&&$guildmates[$args["name"]]) {
/*Do we have a state-change caused by a refresh?*/
if ($guildlookup[$args["name"]]) {
    say("Guildbuddies :: Statuschange caused by a lookup and ignored",1);
}
/*Do we have a statuschange?*/
elseif ($args["status"]!=$args["laststatus"]) {
say ("Guildbuddies :: Buddy ".$args["name"]." changed status from ".$args["laststatus"]." to ".$args["status"],1);
if ($guildmains[$args["name"]])
$main=" (".$guildmains[$args["name"]].") ::";
else
$main="";

#was offline before, so he/she logged on
if     ($args["laststatus"]==0)
$msg=":: ".$args["name"]." :: Level ".$args["level"]." ".classname($args["class"]).":: logged on ::".$main;

#has changed status to 0 => logged off
elseif ($args["status"]==0)
$msg=":: ".$args["name"]." :: Level ".$args["level"]." ".classname($args["class"]).":: logged off ::".$main;

if($args["laststatus"]==0 || $args["status"]==0)
{
              }

#went afk
elseif ($args["status"]==3 && $args["laststatus"]==1)
$msg=$args["name"]." is afk";

#was afk before and is back
elseif ($args["status"]==1 && $args["laststatus"]==3)
$msg=$args["name"]." is back";

send_guild_channel_message(colortext($msg));
say("Guildbuddies :: ".$msg,1);

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #3 on: July 09, 2008, 10:26:23 pm »
the key is in these lines
Code: [Select]
elseif ($args["status"]==3 && $args["laststatus"]==1)
$msg=$args["name"]." is afk";

#was afk before and is back
elseif ($args["status"]==1 && $args["laststatus"]==3)

that means that the meaning of $args[1] in inc_buddy() in Bot.php (around line 990) is as follows:
0 = Offline
1 = Online
2 = ?
3 = AFK

Hmmm, I wonder what 2 is...

Anyhow I'll look into it, though I'm on reduced free time until the weekend now....

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bebot /afk = logoff
« Reply #4 on: July 09, 2008, 11:07:14 pm »
some 1 said somit about logoff when they go on lft maybe thats 2

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Bebot /afk = logoff
« Reply #5 on: July 09, 2008, 11:32:30 pm »
I can confirm 2 is LFT.
Also, AFK takes priority over LFT. Meaning, if someone is AFK, the status will remain AFK regardless of being on LFT or not.

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #6 on: July 10, 2008, 01:37:56 pm »
Thanks - this has been fixed in latest revision. :-)

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #7 on: July 14, 2008, 07:40:42 pm »
Is there anyway in a upcoming release you can make it state in guild chat when someone goes /afk  ?

I know there is a !afk command.  But it would be simpler for the guild if they could just use the /afk command in game and have the bot pick it up.

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #8 on: July 14, 2008, 10:13:31 pm »
it would be possible using a modified version of Sources/Bot.php and Main.php
change Bot.php like this (around line 1054)
Code: [Select]
elseif ($args[1] == 3)
{
// Person is AFK
return;
}
to
Code: [Select]
elseif ($args[1] == 3)
{
// Person is AFK
$this -> bot -> send_gc("$user has gone AFK");
return;
}

and Main.php (line 364) from this:
Code: [Select]
case 20:
// Silently ignore for now (AOCP_CLIENT_NAME)
break;
to
Code: [Select]
case 20:
// Silently ignore for now (AOCP_CLIENT_NAME)
if ($bot -> aoc -> buddy_exists($args[0]))
$bot -> aoc -> buddy_remove($args[0]);
$bot -> aoc -> buddy_add($args[0]);
break;

(it's very similar to the method I use for my autogratz script, but based on the latest svn version of the files)

there is 1 flaw with this atm, if the player forgets they are AFK and starts running around, levelling etc it will send an AFK message to guild chat on each change - I really need to come up with a better method of detecting these changes only when they first occur...
« Last Edit: July 14, 2008, 10:22:46 pm by Vrykolas »

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #9 on: July 14, 2008, 10:29:26 pm »
I actually did make the changes in Bot.php to support the /afk events. You can catch these events in the AFK module. However theres a lot of issues with people going on LFG, taking LFG off etc. And I didn't have time to fix those.

We are currently testing an upgrade of the whole bot to be based on BeBot 0.5.2 and I don't really wanna make a major change in the code before we apply that to the trunk. :)

But Vrykolas has done a good job and I think we can add it to the trunk very soon.

Offline kardsen

  • BeBot Apprentice
  • ***
  • Posts: 81
  • Karma: +0/-0
Re: Bebot /afk = logoff
« Reply #10 on: July 14, 2008, 10:47:51 pm »
hmm, 

I'll hold off on changing this this.
I'll just be content with it not saying people have logged off all the time.


As far as Vry's problem...
Couldn't you make a new SQL table that remembers the players LAST state.  so if the last state is different than the current state it changes it.. Otherwise output nothing?

Hrmm..  Something like that would take me a couple weeks...
but hey!  thats why you guys are in charge of making bebot and I just tinker  :)

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 550
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal