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
-
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)
<?
$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>";
}
}
?>
-
Shouldn't this:
$commands["pgmsg"]["tell"] = &$time;
$commands["gc"]["tell"] = &$time;
be like this:
$commands["pgmsg"]["tell"] = &$tell;
$commands["gc"]["tell"] = &$tell;
-
ehm yes ;)
corrected it and uploaded it again :)