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: AFK Module - Sets a user AFK  (Read 10990 times)

0 Members and 1 Guest are viewing this topic.

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
AFK Module - Sets a user AFK
« on: April 28, 2005, 08:57:34 am »
AFK MODULE

Description:
Sets a user AFK an modifies the !online list to display who is afk.

Instructions:
Quote from: "Org/Tell:"
!afk [message]
Sets a user afk with optional [message]
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline Achali

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
AFK Module - Sets a user AFK
« Reply #1 on: September 12, 2005, 03:52:22 pm »
link broken

Offline Derroylo

  • Contributor
  • *******
  • Posts: 43
  • Karma: +0/-0
AFK Module - Sets a user AFK
« Reply #2 on: September 12, 2005, 10:07:21 pm »
yeah the site is down for a while :(

use this link
http://nne-clan.clanintern.de/bebot/Afk.phps
Derroylo 220/23 NT RK2

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
AFK Module - Sets a user AFK
« Reply #3 on: September 19, 2005, 09:20:48 am »
Getting Connection Refused errors from http://nne-clan.clanintern.de
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Derroylo

  • Contributor
  • *******
  • Posts: 43
  • Karma: +0/-0
AFK Module - Sets a user AFK
« Reply #4 on: September 19, 2005, 08:11:17 pm »
send me a PM with your email adress and i will mail it :)
Derroylo 220/23 NT RK2

Offline myste

  • BeBot Rookie
  • *
  • Posts: 12
  • Karma: +0/-0
  • shallabais
Re: AFK Module - Sets a user AFK
« Reply #5 on: December 25, 2005, 11:45:16 am »
I got some strange recursive behaviour in this module..

Changed the lines comparing message name to botname like so.. :

Code: [Select]
function gmsg($name, $group, $msg) {
if(strtolower($name) != strtolower($this -> bot -> botname)) {

Any better way to do this perhaps?

(btw: im working with the SVN-trunk version)

Offline Ainen

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: AFK Module - Sets a user AFK
« Reply #6 on: February 06, 2006, 11:13:23 pm »
Is there a way to make this module take a user off AFK when they log off? People are logging back on to find themselves still AFK, or, when someone logs off AFK, the bot responds to their name in chat with the 'afk' message.
BeBot 0.3.4 svn 91 // PHP 4.3.9 // MySQL 4.1.12

Offline Tsuyoi

  • BeBot User
  • **
  • Posts: 30
  • Karma: +0/-0
  • BigT
    • Adrenaline Rush Forums
Re: AFK Module - Sets a user AFK
« Reply #7 on: February 08, 2006, 06:38:19 am »
The call for joining/leaving for GC or PG looks like:
Code: [Select]
<?php

$commands
["pgjoin"][] = &$afk
$commands["pgleave"][] = &$afk
$commands["buddy"][] = &$afk;

So just do something like:
Code: [Select]
<?php

function buddy($name$msg
{
  if(
$msg == 1)
    if(
$this -> afk[$name]) {
      unset(
$this -> afk[$name]);
    } 
  }
}

Or something to that effect, I'm getting ready to leave work, so I don't have time to show the module with that included.  I'll edit this when I get home.

- Tsuyoi

MatHack

  • Guest
Re: AFK Module - Sets a user AFK
« Reply #8 on: February 08, 2006, 11:13:43 am »
Code: [Select]
if($msg == 1)should be:
Code: [Select]
if($msg != 1)

Offline Tsuyoi

  • BeBot User
  • **
  • Posts: 30
  • Karma: +0/-0
  • BigT
    • Adrenaline Rush Forums
Re: AFK Module - Sets a user AFK
« Reply #9 on: February 08, 2006, 06:40:27 pm »
Bah, sorry bout that.  Was a five second post right before I left work so I wasn't all there with teh excitement of going home. :D

- Tsuyoi

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Re: AFK Module - Sets a user AFK
« Reply #10 on: March 14, 2006, 08:37:15 pm »
Updated AFK module to unset afk when a user logs off. Sorry I took so long.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline porter

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Re: AFK Module - Sets a user AFK
« Reply #11 on: September 09, 2006, 03:14:16 pm »
Hm, maybe this module has been updated somewhere but just in case someone copies it to their 0.2.x as I did, a couple edits you might want to do:

In the function "tell" which is for handling an incoming tell from a user there are two "if" statements, latter one should be "elseif" otherwise if the user sends a "tell <bot> !afk show" that user is marked as afk with the message "show".

Matter of preference, but I also changed the "elseif" statement in function "gmsg" to:
Code: [Select]
elseif(preg_match('/^afk ?(.*)/i', $msg, $afkmsg) or (preg_match('/^'.$this -> bot -> commpre.'afk ?(.*)/i', $msg, $afkmsg
))) $c = $this -> gone($name, $afkmsg[1]);
That way people can do either afk or !afk (or whatever your command prefix is) in group chat and it marks them afk.

Forgive me if this is more thread necromancy & nitpicking than useful for the general public :)

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: AFK Module - Sets a user AFK
« Reply #12 on: December 03, 2006, 06:26:22 am »
Can anyone post this file with the fixes so !afk or afk works in guild chat?
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: AFK Module - Sets a user AFK
« Reply #13 on: December 04, 2006, 06:31:49 pm »
zip contains both the afk, and a custom brb mod.  Both work the same, with ! and without !.

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: AFK Module - Sets a user AFK
« Reply #14 on: December 04, 2006, 08:06:51 pm »
Thank you!
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

 

* 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: 480
  • 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