collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: send_tell  (Read 3842 times)

0 Members and 1 Guest are viewing this topic.

Offline crocks

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
send_tell
« 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 :)

Offline crocks

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: send_tell
« Reply #1 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);
 }
}
?>

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 446
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal