BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Wanuarmi on December 05, 2005, 09:11:32 am

Title: Assist macro generator
Post by: Wanuarmi on December 05, 2005, 09:11:32 am
This one will open a window with links to create a macro or assist directly, and a couple other stuff

Pretty much the same script alot of people have, but in the bot

syntax is !assist <player name>

Code: [Select]
<?
$assist = new Assist($bot);

$commands["tell"]["assist"] = &$assist;
$commands["pgmsg"]["assist"] = &$assist;
$commands["gc"]["assist"] = &$assist;



  /*
    The Class itself...
  */
  class Assist
  {
    var $bot;
   
   

    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Assist (&$bot)
    {
      $this -> bot = &$bot;
    }



    /*
      This gets called on a tell with the command
    */
    function tell($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "assist (.+)$/i", $msg, $info)) { $output = $info[1]; }
$this -> bot -> send_tell($name, $this -> doAssist($output)) ;
    }



    /*
      This gets called on a msg in the privgroup with the command
    */
    function pgmsg($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "assist (.+)$/i", $msg, $info)) { $output = $info[1]; }
$this -> bot -> send_pgroup($this -> doAssist($output));
    }
   
   
   
    /*
      This gets called on a msg in the guildchat with the command
    */
    function gc($name, $msg)
    {
if (preg_match("/^" . $this -> bot -> commpre . "assist (.+)$/i", $msg, $info)) { $output = $info[1]; }
$this -> bot -> send_gc($this -> doAssist($output));
    }




    /*
    Makes the message
    */
    function doAssist($msg)
    {
$ucname = ucfirst($msg);
    $inside = "<font color=CCInfoText><font color=CCInfoHeader>Macro:</font>\nAssist <a href='chatcmd:///macro $msg /assist $msg'>$ucname</a>\n\n";
$inside .= "<font color=CCInfoHeader>Command:</font>\nAssist <a href='chatcmd:///assist $msg'>$ucname</a>\n\n";
   
$inside .= "<font color=CCInfoHeader>Extras:</font>\nAnnonymous on/off: <a href='chatcmd:///anon'>/anon</a>\n";
$inside .= "Turn auto attack player <a href='chatcmd:///option AutoAttackPvP 1'>on</a> <a href='chatcmd:///option AutoAttackPvP 0'>off</a>\n";
$inside .= "Turn auto target player <a href='chatcmd:///option AutoTargetPvP 1'>on</a> <a href='chatcmd:///option AutoTargetPvP 0'>off</a>\n";
$inside .= "Turn show all names <a href='chatcmd:///option ShowAllNames 1'>on</a> <a href='chatcmd:///option ShowAllNames 0'>off</a>";

  return "Assist: " . $this -> bot -> make_blob($ucname, $inside);
    }
  }
?>
Title: Assist macro generator
Post by: Akarah on December 05, 2005, 11:11:06 am
that is quite handy! thanks :)
Title: Assist macro generator
Post by: skeezix on December 05, 2005, 04:39:27 pm
the !target command does this I think, but only responds to people in the callers list.
nice addition tho :):)
Title: Re: Assist macro generator
Post by: Areteh on January 06, 2007, 07:06:18 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.)
SimplePortal 2.3.7 © 2008-2025, SimplePortal