Archive > AO 0.6 support

send_tell

(1/1)

crocks:

--- Code: --- 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);
}
--- End code ---


--- Code: ---Bebot [TELL]   [OUT] ->     ::[link]Raid Loot Menu[/link]]
--- End code ---

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 :)

crocks:
nvm I figured it out with friends help :) here is full code:

--- Code: ---$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);
 }
}
?>
--- End code ---

Navigation

[0] Message Index

Go to full version