BeBot - An Anarchy Online and Age Of Conan chat automaton

General => Feedback and Suggestions => Topic started by: Hotshot on September 05, 2006, 01:37:07 pm

Title: Few suggestions
Post by: Hotshot on September 05, 2006, 01:37:07 pm
Here is 2 of things i'd like to see put onto the bot.

!members (give list of members)
afk or brb (bot recognises these words and post little script "name" is afk)
Title: Re: Few suggestions
Post by: jjones666 on September 05, 2006, 05:24:35 pm
Both implemented already.

search for !memberlist (by Wolfbiter) and !afk (by Craized).  suggest to download v1.1 of !afk which is superior to the one distributed with Bebot (last time I looked).  This will add an "AFK" next to the !online list.

Cheers,

-jj-
Title: Re: Few suggestions
Post by: Wolfbiter on September 06, 2006, 09:35:54 am
I can't promise my script will work with latest bebot, was a while since I wrote it and have no idea what possible database changes may have happend since.
Title: Re: Few suggestions
Post by: jjones666 on September 06, 2006, 01:07:42 pm
I'll convert that one myself once I update to Bebot 0.3, it's bloody useful :-)

-jj-
Title: Re: Few suggestions
Post by: Khalem on September 06, 2006, 02:13:51 pm
Members list is planned for 0.3/0.5

Im not entirely happy with the AFK module for BeBot, and i actually find myself missing the AFK functionality from IGN. I don't know when i will find time to do something about it though.
Title: Re: Few suggestions
Post by: Malosar on September 06, 2006, 02:18:48 pm
Members list is planned for 0.3/0.5

Im not entirely happy with the AFK module for BeBot, and i actually find myself missing the AFK functionality from IGN. I don't know when i will find time to do something about it though.

From what I remember, mentioning someones name in chat that was afk spawned an afk message from the bot, which is what I miss. Is that what you mean? Not sure what else it did.
Title: Re: Few suggestions
Post by: Khalem on September 06, 2006, 02:20:31 pm
Yes, it's one of the things i miss.
Another thing was also that you didn't need to use a command prefix for the afk commands to be picked up.
Title: Re: Few suggestions
Post by: Malosar on September 06, 2006, 02:33:12 pm
The AFK module I run doesn't require a command prefix, it will do it with or without.

Code: [Select]
        function gmsg($name, $group, $msg) {
                if($name != ucfirst($this -> bot -> botname)) {
                        if(preg_match('/^'.$this -> bot -> commpre.'afk show$/i', $msg)) $c = $this -> list_afk();
                        elseif(preg_match('/^afk ?(.*)/i', $msg, $afkmsg)) $c = $this -> gone($name, $afkmsg[1]);
                        elseif(isset($this -> afk[$name])) $c = $this -> back($name);
                        $c != '' ? $this -> bot -> send_gc($c) : NULL;
                }
        }
Title: Re: Few suggestions
Post by: Malosar on September 07, 2006, 02:32:13 pm
The section I posted was just the gmsg section of the AFK module showing it listening for afk without a "!".

Here is the entire module:

Code: [Select]
<?php
/*
* AFK Module for BE Bot <http://bebot.fieses.net>
* Module coded by Craized <http://www.craized.net>
* v1.01
* Special thanks to Lal for bug fixes, styles, and development

/*
Add a '_' at the beginning of the file (_AFK.php) if you do not want it to be loaded.
*/

$afk = new AFK($bot);

$commands['tell']['afk'] = &$afk;
$commands['privgroup'][] = &$afk;
$commands['gmsg'][$guild_name][] = &$afk;
$commands["buddy"][] = &$afk;

Class 
AFK {
        var 
$bot;
        var 
$afk;

        function 
AFK(&$bot) {
                
$this -> bot = &$bot;
                
$this -> afk = array();
                
$this -> bot -> db -> query('INSERT IGNORE INTO settings (setting, value) VALUES ("highlight_1", "CB11C9")');
                
$this -> highlight_1 = !method_exists($this -> botget_setting) ? '<font color=#CB11C9>' '<font color=#'.$this -> bot -> get_setting('highlight_1').'>';
        }

function 
buddy($name$msg)     {
  if(
$msg != 1)
    if(
$this -> afk[$name]) unset($this -> afk[$name]);
}
        
        function 
tell($name$msg) {
                if(
preg_match('/^'.$this -> bot -> commpre.'afk ?(.*)/i'$msg$afkmsg)) $c $this -> gone($name$afkmsg[1]);
                if(
preg_match('/^'.$this -> bot -> commpre.'afk show$/i'$msg)) $c $this -> list_afk();
                
$c != '' $this -> bot -> send_gc($c) : NULL;
        }

        function 
privgroup($name$msg) {
                if(
$name != ucfirst($this -> bot -> botname)) {
                        if(
preg_match('/^'.$this -> bot -> commpre.'afk show$/i'$msg)) $c $this -> list_afk();
                        elseif(
preg_match('/^afk ?(.*)/i'$msg$afkmsg)) $c $this -> gone($name$afkmsg[1]);
                        elseif(isset(
$this -> afk[$name])) $c $this -> back($name);
                        
$c != '' $this -> bot -> send_pgroup($c) : NULL;
                }
        }

        function 
gmsg($name$group$msg) {
                if(
$name != ucfirst($this -> bot -> botname)) {
                        if(
preg_match('/^'.$this -> bot -> commpre.'afk show$/i'$msg)) $c $this -> list_afk();
                        elseif(
preg_match('/^afk ?(.*)/i'$msg$afkmsg)) $c $this -> gone($name$afkmsg[1]);
                        elseif(isset(
$this -> afk[$name])) $c $this -> back($name);
                        
$c != '' $this -> bot -> send_gc($c) : NULL;
                }
        }

        function 
gone($name$msg) {
                
$this -> afk[$name] = empty($msg) ? 'Away from keyboard' $msg;
                
$c $this -> highlight_1.$name.'</font> is now AFK.';
                return 
$c;
        }

        function 
back($name) {
                if(isset(
$this -> afk[$name])) {
                        unset(
$this -> afk[$name]);
                        
$c $this -> highlight_1.$name.'</font> has returned from away.';
                }
                return 
$c;
        }

        function 
list_afk() {
                
$blob '::::: '.$this -> bot -> guildname.(preg_match("#s$#i"$this -> bot -> guildname) ? '\'' '\'s').' AFK List :::::';
                
$blob .= "\n\n\n";
                foreach(
$this -> afk as $key=>$value) {
                        
$blob .= $this -> highlight_1.$key.'</font> is AFK ('.$value.')';
                        
$blob .= "\n\n";
                }
                
$c $this -> bot -> make_blob('User\'s AFK'$blob);
                return 
$c;
        }
}
?>

SimplePortal 2.3.7 © 2008-2025, SimplePortal