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

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

Author Topic: Raid Command  (Read 3269 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Raid Command
« on: November 19, 2005, 01:32:49 am »
This will add the commands !c and !cmacro to the private channel, just save as RaidCommand.php

They are for raid leader orders to stand out on the chat

Code: [Select]
<?
$raidCommand = new RaidCommand($bot);

$commands["tell"]["c"] = &$raidCommand;
$commands["pgmsg"]["c"] = &$raidCommand;

$commands["tell"]["cmacro"] = &$raidCommand;
$commands["pgmsg"]["cmacro"] = &$raidCommand;

class RaidCommand
{
    var $bot;



    function RaidCommand (&$bot)
    {
      $this -> bot = &$bot;
    }



    function tell($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "c .*$/i", $msg))
                $this -> doRaidCommand($name, $msg);
else if (preg_match("/^" . $this -> bot -> commpre . "cmacro .*$/i", $msg))
                $this -> doRaidCommandMacro($name, $msg);
    }



    function pgmsg($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "c .*$/i", $msg))
                $this -> doRaidCommand($name, $msg);
else if (preg_match("/^" . $this -> bot -> commpre . "cmacro .*$/i", $msg))
                $this -> doRaidCommandMacro($name, $msg);
    }


function doRaidCommand($name, $msg)
{
if ($this -> bot -> admin -> in_group($name, "leader") || $this -> bot -> admin -> in_group($name, "admin"))
{
$output = $msg;
if (preg_match("/^" . $this -> bot -> commpre . "c (.+)$/i", $msg, $info)) { $output = $info[1]; }
$message = "<font color=red>Raid Command</font> by <font color=yellow>$name</font>\n";
$message .= "<font color=yellow>            ==========================================</font>\n";
$message .= "            ".$output;
$message .= "\n<font color=yellow>            ==========================================</font>";
$this -> bot -> send_pgroup($message);
}
}


function doRaidCommandMacro($name, $msg)
{
if ($this -> bot -> admin -> in_group($name, "leader") || $this -> bot -> admin -> in_group($name, "admin"))
{
$output = $msg;
if (preg_match("/^" . $this -> bot -> commpre . "cmacro (.+)$/i", $msg, $info)) { $output = $info[1]; }
    $inside = "<font color=CCInfoText><font color=CCInfoHeader>Macro:</font>\n<a href='chatcmd:///macro <bot> $output'>$output</a>\n\n";
$inside .= "<font color=CCInfoHeader>Command:</font>\n<a href='chatcmd://$output'>$output</a>\n\n";
  $macro = $this -> bot -> make_blob($output, $inside);

$message = "<font color=red>Raid Command</font> by <font color=yellow>$name</font>\n";
$message .= "<font color=yellow>            ==========================================</font>\n";
$message .= "            ".$macro;
$message .= "\n<font color=yellow>            ==========================================</font>";
$this -> bot -> send_pgroup($message);
}
}
}
?>

Offline Areteh

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Raid Command
« Reply #1 on: January 06, 2007, 06:38:24 am »
help file.  (yeah, I'm spamming them a bit, just figured since I'm writing them for my own bots, I may as well share.)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 384
  • 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