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
<?
$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);
}
}
}
?>