BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Derroylo on May 29, 2005, 08:16:28 pm

Title: Tell Modul - Repeats a Msg Three Times
Post by: Derroylo on May 29, 2005, 08:16:28 pm
My first Script for this great bot :)

Description: It simply repeats the msg three times
Use :          !tell <msg>
Download:    Download Link (http://www.nne-clan.clanintern.de/bebot/tell.zip)

Code: [Select]

<?
$tell = new Tell($bot);

$commands["pgmsg"]["tell"] = &$tell;
$commands["gc"]["tell"] = &$tell;

/*
The Class itself...
*/
class Tell
{
var $bot;
    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Tell (&$bot)
{
$this -> bot = &$bot;
    }

    /*
      This gets called on a msg in the guildchat with the command
    */
    function gc($name, $msg)
    {
    if (preg_match("/^" . $this -> bot -> commpre . "tell (.+)$/i", $msg, $info)) {
    $this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
}
    }

    /*
      This gets called on a msg in the privgroup with the command
    */
    function pgmsg($name, $msg)
{
    if (preg_match("/^" . $this -> bot -> commpre . "tell (.+)$/i", $msg, $info)) {
    $this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
$this -> bot -> send_pgroup($this -> send_tell($info[1]));
}
    }

    function send_tell($msg)
    {
      return "<font color=#9CC6E7>".$msg."</font>";
    }
}
?>
Title: Tell Modul - Repeats a Msg Three Times
Post by: Zarkingu on September 10, 2005, 05:58:04 pm
Shouldn't this:

$commands["pgmsg"]["tell"] = &$time;
$commands["gc"]["tell"] = &$time;

be like this:

$commands["pgmsg"]["tell"] = &$tell;
$commands["gc"]["tell"] = &$tell;
Title: Tell Modul - Repeats a Msg Three Times
Post by: Derroylo on September 10, 2005, 10:59:03 pm
ehm yes ;)

corrected it and uploaded it again :)
SimplePortal 2.3.7 © 2008-2025, SimplePortal