BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => AO 0.6 support => Topic started by: crocks on July 23, 2012, 09:33:14 pm

Title: send_tell
Post by: crocks on July 23, 2012, 09:33:14 pm
Code: [Select]
function make_raidloot()
{
$content = "<font color=CCInfoHeadline> :::: Raid Loot Menu ::::</font>\n\n";
if(file_exists("./txt/".$this -> bot -> botname."_raidloot.txt"))
$content .= implode("", file("./txt/".$this -> bot -> botname."_raidloot.txt"));
elseif(file_exists("./txt/raidloot.txt"))
$content .= implode("", file("./txt/raidloot.txt"));

$msg = "::" . $this -> bot -> core("tools") -> make_blob("Raid Loot Menu", $content);
$this -> addmsg = "$msg";
$this -> bot -> send_tell($name, $this -> addmsg);
}

Code: [Select]
Bebot [TELL]   [OUT] ->     ::[link]Raid Loot Menu[/link]]
Hi guys I would like to call the function and send the output by tell to whoever called it. Atm it looks like Im missing something. Looks like $name does nothing and seems to be innactive. The bot actually sends a tell but not to $name. Does anyone know what have I forgotten please?

Thanks :)
Title: Re: send_tell
Post by: crocks on July 25, 2012, 01:05:36 am
nvm I figured it out with friends help :) here is full code:
Code: [Select]
$raidloot = new raidloot($bot);



/*
The Class itself...
*/
class raidloot extends BaseActiveModule
{
function __construct(&$bot)
{
parent::__construct(&$bot, get_class($this));

$this -> register_command('all', 'raidloot', 'LEADER');
$this -> help['command']['raidloot'] = 'Shows raid loot menu.';
}



/*
This gets called on a tell with the command
*/
function command_handler($name, $msg, $origin)
{
return $this -> make_raidloot($name);
}



/*
Make the raidloot
*/
  function make_raidloot($name)
  {
  $content = "<font color=CCInfoHeadline> :::: Raid Loot Menu ::::</font>\n\n";
    if(file_exists("./txt/".$this -> bot -> botname."_raidloot.txt"))
    $content .= implode("", file("./txt/".$this -> bot -> botname."_raidloot.txt"));
    elseif(file_exists("./txt/raidloot.txt"))
  $content .= implode("", file("./txt/raidloot.txt"));

  $msg = "::" . $this -> bot -> core("tools") -> make_blob("Raid Loot Menu", $content);
  $this -> addmsg = $msg;
  $this -> bot -> send_tell($name, $this -> addmsg);
 }
}
?>
SimplePortal 2.3.7 © 2008-2024, SimplePortal