I made an little addition to this .. making it possible to dropa pattern for the pocket boss instead of typing name of it ... here is the code
<?
/*
*Not in AOPocket:
*Alert Left Arm, Extermination - Anansi's Adherent
*Cognizant Right Arm, Control - Ushqa
*Effective Left Hand, Control - Shake
*Cognizant Feet Symbiant, Infantry - Sashu
*Cognizant Right Wrist Symbiant, Artillery - Sashu
*Cognizant Ocular Symbiant, Extermination - Sashu
*Cognizant Brain Symbiant, Extermination - Sashu
*Cognizant Left Hand Symbiant, Infantry - Sashu
*Cognizant Thigh Symbiant, Infantry - Sashu
*/
include_once("_Colors.php");
$pb = new PB($bot);
$commands["gc"]["pb"] = &$pb;
$commands["tell"]["pb"] = &$pb;
$commands["pgmsg"]["pb"] = &$pb;
$commands["gc"]["symb"] = &$pb;
$commands["tell"]["symb"] = &$pb;
$commands["pgmsg"]["symb"] = &$pb;
class PB
{
var $bot;
var $symbdata = array(
array (170,'eye','artillery','Adobe Suzerain','Scheol Upper','Highlands NW Incarnator N','Eremites',125,219135,'QL 170 Active Ocular Symbiant, Artillery Unit Aban'),
array (170,'legs','infantry','Adobe Suzerain','Scheol Upper','Highlands NW Incarnator N','Eremites',125,235792,'QL 170 Active Thigh Symbiant, Infantry Unit Aban'),
array (150,'feet','infantry','Adobe Suzerain','Scheol Upper','Highlands NW Incarnator N','Eremites',125,235825,'QL 150 Surviving Feet Symbiant, Infantry Unit Aban') ...
edited some off the array out ...
function PB (&$bot)
{
$this -> bot = &$bot;
}
function gc($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "pb <a (.+) '(.+)'(.+)/i", $msg, $info)) {
$this -> bot -> send_gc("Searching for " . $info[2] );
$this -> bot -> send_gc($this -> SearchPB($info[2]) );
} else if (preg_match("/^" . $this -> bot -> commpre . "pb (.+)/i", $msg, $info)) {
$this -> bot -> send_gc($this -> SearchPB($info[1]));
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet) (support|control|infantry|artillery|extermination)/i", $msg, $info)) {
$this -> bot -> send_gc($this -> SearchSymb($info[1], $info[2]), "symb");
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (support|control|infantry|artillery|extermination) (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet)/i", $msg, $info)) {
$this -> bot -> send_gc($this -> SearchSymb($info[2], $info[1]), "symb");
}
}
function pgmsg($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "pb <a (.+) '(.+)'(.+)/i", $msg, $info)) {
$this -> bot -> send_pgroup("Searching for " . $info[2] );
$this -> bot -> send_pgroup($this -> SearchPB($info[2]) );
} else if (preg_match("/^" . $this -> bot -> commpre . "pb (.+)/i", $msg, $info)) {
$this -> bot -> send_pgroup($this -> SearchPB($info[1]));
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet) (support|control|infantry|artillery|extermination)/i", $msg, $info)) {
$this -> bot -> send_pgroup($this -> SearchSymb($info[1], $info[2]), "symb");
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (support|control|infantry|artillery|extermination) (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet)/i", $msg, $info)) {
$this -> bot -> send_pgroup($this -> SearchSymb($info[2], $info[1]), "symb");
}
}
function tell($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "pb <a (.+) '(.+)'(.+)/i", $msg, $info)) {
$this -> bot -> send_tell($name, "Searching for " . $info[2] );
$this -> bot -> send_tell($name, $this -> SearchPB($info[2]) );
} else if (preg_match("/^" . $this -> bot -> commpre . "pb (.+)/i", $msg, $info)) {
$this -> bot -> send_tell($name, $this -> SearchPB($info[1]));
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet) (support|control|infantry|artillery|extermination)/i", $msg, $info)) {
$this -> bot -> send_tell($name, $this -> SearchSymb($info[1], $info[2]), "symb");
} else if (preg_match("/^" . $this -> bot -> commpre . "symb (support|control|infantry|artillery|extermination) (eye|head|ear|rarm|chest|larm|rwrist|waist|lwrist|rhand|legs|lhand|feet)/i", $msg, $info)) {
$this -> bot -> send_tell($name, $this -> SearchSymb($info[2], $info[1]), "symb");
}
}
function CreateBlob($data, $mode="pb")
{
if($mode == "pb") {
$msg = Headertext("::::: Remains of ".$data[0][3]." :::::\n\n");
$msg .= Grouptext(
Highlight("Location: ").$data[0][4]."\n"
.Highlight("Found on: ").$data[0][6]."\n"
.Highlight("Mob Level: ").$data[0][7]."\n"
.Highlight("General Location: ").$data[0][5]."\n"
."____________________________________ \n"
);
asort($data);
foreach($data as $symb) {
$msg .= "<a href='itemref://".$symb[8]."/".$symb[8]."/".$symb[0]."'>".$symb[9]."</a>\n";
}
return $this -> bot -> make_blob("Remains of ".$data[0][3], $msg);
} else {
$msg = Headertext("::::: Result of your search :::::\n\n");
ksort($data);
foreach($data as $symb) {
$msg .= "<a href='itemref://".$symb[8]."/".$symb[8]."/".$symb[0]."'>".$symb[9]."</a>\n";
$msg .= Grouptext(" Found on ")."<a href='chatcmd:///tell <botname> <pre>pb ".$symb[3]."'>".$symb[3]."</a>\n\n";
}
return $this -> bot -> make_blob("Found ".count($data)." matches", $msg);
}
}
function SearchSymb($location, $art)
{
$return = array();
foreach ($this -> symbdata as $pb) {
if(stristr($pb[1], $location) && stristr($pb[2], $art)) {
$return[] = $pb;
}
}
if(!$return) {
return "Could not find any Pocketboss for \"".Highlight($location." ".$art)."\"";
} else {
return $this -> CreateBlob($return, "symb");
}
}
function SearchPB($search)
{
$return = array();
foreach ($this -> symbdata as $pb) {
if(stristr($pb[3], $search)) {
$return[] = $pb;
}
}
if(!$return) {
return "Could not find the Pocketboss \"".Highlight($search)."\"";
} else {
return $this -> CreateBlob($return, "pb");
}
}
}
?>
/regards chowkow