BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => AO 0.6.x Custom/Unofficial modules => Anarchy Online Archive => AO official modules => Topic started by: Derroylo on September 10, 2005, 01:39:10 am

Title: Pocketboss and Symbiant module
Post by: Derroylo on September 10, 2005, 01:39:10 am
With this module you can see what pb drops which symbiants and what symbiants are dropping from which pocketboss.

Commands
!pb "pocketboss name"
- Show the list of the dropping symbiants

!symb "place" "type"
- Shows the pocketbosses that drops your needed symbiant

You need these two files to get it to work
http://nne-clan.clanintern.de/bebot/_Colors.phps
http://nne-clan.clanintern.de/bebot/PB.phps
Title: Pocketboss and Symbiant module
Post by: Khalem on September 10, 2005, 06:07:22 am
Nice one.

Small comment for this and your teamspeak plugin.

Use include_once instead of include. Else anyone installing both your plugins will get errors related to redefinition of functions.
Title: Pocketboss and Symbiant module
Post by: Derroylo on September 10, 2005, 02:11:23 pm
yeah sry have corrected it :)
Title: Pocketboss and Symbiant module
Post by: Plac3bo on October 06, 2005, 08:48:03 am
Why are these files phps? and not php?

I admit it, im a n00b :) But I downloaded them as they where and couldnt get the command to work..
Title: Pocketboss and Symbiant module
Post by: Blondengy on October 06, 2005, 10:12:19 am
phps = php-source
Its just so that the server doesn't interpert/execute them instead of showing the source... You'll have to rename them to .php to get them to work. ;)
Title: Pocketboss and Symbiant module
Post by: iriche on October 06, 2005, 12:33:27 pm
Im thinking about posting mine...
yeah Ill do that later today
Title: Pocketboss and Symbiant module
Post by: Xenixa on October 19, 2005, 11:41:42 am
Think I found a Bug with the Symb command.

When it pulls the results and offers Clickies to the PB in the Info window it doesn't add syntax to the front of pb

I.E. I use ! for syntax, links created show for example:

/tell <bot> pb <bossname>

EDIT:  Never mind, I fixed it. I was missing the <pre> infront of pb in the code below.
Code: [Select]
$msg .= Grouptext("   Found on ")."<a href='chatcmd:///tell <botname> <pre>pb ".$symb[3]."'>".$symb[3]."</a>\n\n";
Title: Pocketboss and Symbiant module
Post by: Wanuarmi on November 13, 2005, 05:23:28 am
found a little bug/typo

Code: [Select]
 $commands["gc"]["pb"] = &$pb;
  $commands["tell"]["pb"] = &$pb;
  $commands["pgmsg"]["pb"] = &$pb;
  $commands["gc"]["symb"] = &$pb;
  $commands["tell"]["symb"] = &$pb;
  $commands["pgmsg"]["pb"] = &$pb;


the second pgmsg shoud be symb or you wont be able to use it on private channel.
Title: Pocketboss and Symbiant module
Post by: jjones666 on November 19, 2005, 03:13:36 am
Search Bug:

!pb Suzerain should return:

Adobe Suzerain
Kaoline Suzerain
Loessial Suzerain etc etc

However, returns only the first PB found with all the symbs from the others attached.

Cheers,

-jj-
Title: Pocketboss and Symbiant module
Post by: jjones666 on November 20, 2005, 01:01:57 pm
I added all the missing PBs to the file (there were about 10 or so), I couldn't figure out the problem with the searching so that still needs to be fixed.  The list should be accurate with Aopocket's information now.

Let me know if any issues.

Cheers,

-jj-

http://www.jjones.co.uk/files/pb.php
Title: Pocketboss and Symbiant module
Post by: Xenixa on November 20, 2005, 07:00:32 pm
Link doesn't seem to be working.

As for the search issue in that module. The mod is only setup to return one PB with a clicky link. So if mulitple PB's have simular names your going to get all Symbs listed in one window with the 1 provided blob.

I been meaning to re-write this one myself to return multiple bosses in a window, kinda like the items command does if it finds more than one item. Also was going to have it search a DB table rather than having that huge Array in pb.php stuffed into memory. Already have the data stuffed into a .sql script file and on a table in the db actually. :) Just a matter of re-writing the search function or adapting the one from items.php

Here's the SQL version of the Symbs/PB's: ftp://xen.afraid.org/bebot_files/pbsymbs.sql
doesn't include your additional symbs btw
Title: Pocketboss and Symbiant module
Post by: jjones666 on November 24, 2005, 01:54:05 am
Hi,
Hopefully link should be working now...
Cheers,
-jj-
Title: Pocketboss and Symbiant module
Post by: Wanuarmi on December 06, 2005, 02:43:34 am
heres a couple helpfiles for this module

pb.txt and symb.txt

Code: [Select]
<font color=CCInfoHeader><pre>pb &lt;pocketboss&gt;</font>
<font color=CCInfoText>Shows info on pocketbosses.</font>


Code: [Select]
<font color=CCInfoHeader><pre>symb &lt;slot&gt; &lt;type&gt;</font>
<font color=CCInfoText>Shows info on symbiants.

Slot
( eye | head | ear | rarm | chest | larm | rwrist | waist | lwrist | rhand | legs | lhand | feet )

Type
( support | control | infantry | artillery | extermination )
Title: Re: Pocketboss and Symbiant module
Post by: jjones666 on December 14, 2005, 02:29:01 am
Added following symbs which are not on AOPocket or any other PB module AFAIK (will add more as found).
Thanks Enrubi and Pinnag from Storm.

Alert Left Arm Extermination, Anansi's Adherent
Cognizant Right Arm Control, Ushqa
Effective Left Hand Control, Shake

www.jjones.co.uk/files/pb.php

*pokes Xenixa*

Cheers,

-jj-

Title: Re: Pocketboss and Symbiant module
Post by: Khalem on December 14, 2005, 03:28:37 am
Hrm, im starting to think it would be better to move the array of symbiants into the database.
Title: Re: Pocketboss and Symbiant module
Post by: Alreadythere on December 14, 2005, 01:07:32 pm
Hrm, im starting to think it would be better to move the array of symbiants into the database.
Just look here (http://www.m8y.de/ao/bebot/pbs.zip). Made tables out of the information I got on aopockets.
Title: Re: Pocketboss and Symbiant module
Post by: Xenixa on December 14, 2005, 02:05:04 pm
*pokes Xenixa*

Cheers,

-jj-

Heheh... still havn't got around to converting this one yet to work off the db, that for some odd reason I keep updating.
Had some Org members pressing me to get Guest auto inviting working, which I finished last night.
Title: Re: Pocketboss and Symbiant module
Post by: jjones666 on January 02, 2006, 12:32:01 am
Added following symbs (not on AOPocket):

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

www.jjones.co.uk/files/pb.php

Thanks again Enrubi and Octopuss for help,

Cheers,

-jj-
Title: Re: Pocketboss and Symbiant module
Post by: Malosar on March 30, 2006, 04:50:11 am
Not sure if anyone ever noticed this but when you create the blob for a return on matches on the !symb command, you return with links for the pocketbosses with just /tell botname pb etc... no prefix if they have one.

Just add a simple <pre> before pb (/tell <botname> <pre>pb...) and it's fixed.
Title: Re: Pocketboss and Symbiant module
Post by: Nogoal on April 04, 2006, 02:19:13 pm
http://bebot.shadow(...)#msg790 (http://bebot.link/index.php/topic,148.msg790.html#msg790) :D
Title: Re: Pocketboss and Symbiant module
Post by: Nogoal on April 19, 2006, 02:51:24 pm
*Excited Thigh Symbiant, Artillery Unit Aban - The Worm King
*Effective Right Arm Symbiant, Infantry Unit Aban - Churn
*Vigorous Right Wrist Symbiant, Artillery Unit Aban - Churn

Those were on aopocket but not inside file

http://ao.inutiles.be/pb.phps
Title: Re: Pocketboss and Symbiant module
Post by: Malosar on April 20, 2006, 03:09:17 am
http://bebot.shadow(...)#msg790 (http://bebot.link/index.php/topic,148.msg790.html#msg790) :D

Pays to read the whole thread eh?
Title: Re: Pocketboss and Symbiant module
Post by: senare on September 06, 2006, 11:35:40 pm
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
Quote
<?

/*
*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 ...
Quote
   
   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
Title: Re: Pocketboss and Symbiant module
Post by: jjones666 on September 07, 2006, 12:13:12 am
TBH, I would suggest this module be deleted and the .sql based one only is used.

Unless someone wants to update the array list (I won't) to sync it with the .sql version.

What do you think for 0.3 Khalem?

Cheers,

-jj-
Title: Re: Pocketboss and Symbiant module
Post by: Khalem on September 07, 2006, 07:06:52 am
SQL based hands down.
Easier to maintain aswell.
Title: Re: Pocketboss and Symbiant module
Post by: Vhab on September 08, 2006, 10:29:42 am
I think databases like these are perfect to do in SQLite.
You can ship the .db3 files and all people need to do is download it and overwrite it while still maintaining the search features of an SQL database.
Title: Re: Pocketboss and Symbiant module
Post by: Xenixa on September 15, 2006, 03:56:53 pm
We have that now Vhab with MySQL.

See: http://bebot.link/index.php/topic,306.0.html
Importing an .sql file is a snap. :)

But ya, I agree that other Symbs module I linked to should replace this one as the official mod. I've already migrated to it on 0.3.3. Worked without any changes to it.
Title: Re: Pocketboss and Symbiant module
Post by: kennethx on March 06, 2009, 11:17:03 am
Not sure if this post is just very outdated, or I'm posting in the wrong place.

Anyway, I noticed that the symb listing no longer showed from what PB a given symb drops, and guildies where missing that feature, so I added it back in modding the Symbiants.php file from the 0.6.1 release.

changes as follows:
Code: [Select]
$title = "QL {$symb['ql']} {$symb['symb']} ".array_search($symb['slot'], $this->slots)." symbiant, {$symb['unit']} unit aban";
$title = ucwords($title);
$link = "<a href='itemref://{$symb['itemref']}/{$symb['itemref']}/{$symb['ql']}'>$title</a>";
$readable_output .= "$link\n";
$title = "{$symb['boss']} ";
$title = ucwords($title);
$link = "<a href='chatcmd:///tell <botname> !pb $title'>$title</a>";
$readable_output .= "From: " . "$link\n\n";

I also attached the file with the changes.
Title: Re: Pocketboss and Symbiant module
Post by: kennethx on March 06, 2009, 01:55:20 pm
Hmm, I ran into an interesting bug...with my above mod, if you do !symb, to list all symbs, the bot crashes. Without the mod it does not.

If you do !symb head, or any other refining parameter, it's fine. I'm suspecting that the pure length of the buffer is getting to large?!!? in case of the complete listing with the pb info included as well.

I've just done a easy fix for now, only displaying the pm info if the search is refined by ether slot, unit or ql (yes, you can still crash it if you do !symb 0-300 I guess :))

Code: [Select]
$title = "QL {$symb['ql']} {$symb['symb']} ".array_search($symb['slot'], $this->slots)." symbiant, {$symb['unit']} unit aban";
$title = ucwords($title);
$link = "<a href='itemref://{$symb['itemref']}/{$symb['itemref']}/{$symb['ql']}'>$title</a>";
$readable_output .= "$link\n";
if($query_slot !== false || $query_ql !== false || $query_unit !== false)
{
   $title = "{$symb['boss']}";
   $title = ucwords($title);
   $link = "<a href='chatcmd:///tell <botname> !pb $title'>$title</a>";
   $readable_output .= "From: " . "$link\n\n";
}
Title: Re: Pocketboss and Symbiant module
Post by: Temar on March 07, 2009, 02:30:18 am
there is a issue with blob being too large even for the current splitter, i have a fix for it that will be in 0.6.3
Title: Re: Pocketboss and Symbiant module
Post by: kennethx on July 09, 2010, 12:46:05 am
Any reason why my pb link mod has not been included in any of the releases made since I posted the mod long ago? :)

It's a bit annoying to have to patch the symbiants.php file every release :)
Title: Re: Pocketboss and Symbiant module
Post by: kennethx on August 08, 2010, 02:39:29 pm
bump :)
SimplePortal 2.3.7 © 2008-2024, SimplePortal