BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.3.x Custom/Unofficial Modules => Topic started by: pod13 on May 13, 2007, 12:59:47 am

Title: Whompa Module
Post by: pod13 on May 13, 2007, 12:59:47 am
I've updated and ported the Whompa module I originally wrote for IGN bot to BeBot.

The Whompa module has three options:
<pre>whompa cities: Displays a list of known cities
<pre>whompa <city>: Shows the whompas for that city
<pre>whompa <origin> <destination>: Calculates a route from the origin city to the destination city.

* The whompa plugin does not use the Jobe whompas.
* The whompa plugin does not use the grid

Cities can be specified using either the city name or the zone.  The regex used to identify cities and zones was originally the one from Kuren's Helpbot (I believe) but I've done some tweaking over the years.  There may be some common abbreviations for locations which are not included in my match rules.  I don't play an Omni char so I don't know the short-hand used for all of those locations.

For example, either of these commands should work:
Code: [Select]
you: !whompa oa bor
bot: Old Athen -> Tir -> ICC -> Newland City -> Borealis :: Details

you: !whompa mmd ent
bot: Newland Desert -> Newland City -> ICC -> Omni Trade -> Omni Entertainment :: Details

The module color-codes the cities by Faction based on the colors used for whompa routes in the Atlas of Rubi-Ka (formerly CSPMap), but this feature isn't working correctly at the moment.

The attachment includes the module (a php file) and the help (a txt file).

Let me know if I've missed something.

POD13

*EDIT* 5/17 -- Fixed commpre bug.
Title: Re: Whompa Module
Post by: Glarawyn on May 14, 2007, 06:00:47 pm
I noticed you don't have the Jobe whompas. Is the Omni whompa to The Longest Road also excluded?
Title: Re: Whompa Module
Post by: pod13 on May 15, 2007, 02:13:29 am
The Jobe whompas aren't included by design.  I'm on the fence about adding them, you know, because of froobs.

The Omni route to The Longest Road is in there named, The Longest Road.  This should cause much grief to clanners.  If I'm looking for a route the TLR I really want to go to Bliss but since cities are matched before zones that won't happen. I should rename the Omni route to TLR to Omni-Tek Mine and then a request for TLR will match both Clan and Omni routes.
Title: Re: Whompa Module
Post by: tonyuh on May 15, 2007, 06:07:58 pm
Code: [Select]
$this -> cityTable  = $this -> bot -> define_tablename("whompa_cities", "true");
$this -> connectorTable = $this -> bot -> define_tablename("whompa_connectors", "true");

My define_tablename() has 3 args, but theres only 2 here... are you using another function that I dont' have?

Cheers,
Tony
Title: Re: Whompa Module
Post by: Alreadythere on May 15, 2007, 06:38:26 pm
My define_tablename() has 3 args, but theres only 2 here... are you using another function that I dont' have?
SVN version only got two parameters, $name and $prefix. If you got $suffix there you got the version I used in the beginning, just change $suffix) to $suffix = "false") then.
Title: Re: Whompa Module
Post by: tonyuh on May 15, 2007, 11:38:15 pm
ah ok thanks.. now it doesn't crash the bot anymore.. but I'm getting "Try /tell bot !help !whompa" with every commands. Is there something extra I need to do or this just doesn't work with bebot 0.2.x?

Cheers,
Tony
Title: Re: Whompa Module
Post by: Alreadythere on May 15, 2007, 11:41:15 pm
It should work with 0.2 too, do you have rights management implemented? Then you got to enable the command (didn't check source code of the module myself...).
Title: Re: Whompa Module
Post by: tonyuh on May 15, 2007, 11:55:43 pm
Is rights managment a module or something? From my understanding... all the rights management I use is "in_group($name, "admin")" or similar.

Tony
Title: Re: Whompa Module
Post by: Alreadythere on May 16, 2007, 12:10:10 am
I posted my first version of rights management somewhere, which allowed enabling and disabling of commands per user group.

But if you don't know about it you most likely don't have it in your bots :)

No clue what's the problem then, sorry.
Title: Re: Whompa Module
Post by: pod13 on May 16, 2007, 05:45:56 am
I'm getting "Try /tell bot !help !whompa" with every commands. Is there something extra I need to do or this just doesn't work with bebot 0.2.x?

So if you do "/tell bot !whompa cities" it replies with "Try /tell bot !help !whompa"?
Title: Re: Whompa Module
Post by: tonyuh on May 16, 2007, 11:49:40 am
yes, this is what i get

Code: [Select]
To [Eobot]: !whompa
Eobot: Try /tell Eobot !help !whompa
To [Eobot]: !whompa cities
Eobot: Try /tell Eobot !help !whompa
To [Eobot]: !whompa city
Eobot: Try /tell Eobot !help !whompa
To [Eobot]: !whompa bor
Eobot: Try /tell Eobot !help !whompa
To [Eobot]: !whompa bor oa
Eobot: Try /tell Eobot !help !whompa

Cheers,
Tony
Title: Re: Whompa Module
Post by: pod13 on May 16, 2007, 12:54:51 pm
That's messed up.  I should probably download 0.2.x bot and play with it but I won't have time until Thursday at least.

I didn't implement any security checking within the module.  It runs through a series of regex checks trying to identify the command and if it falls to the bottom it replies with the Help message.  Hmm, so none of the regex checks are matching...

Is this defined in 0.2.x?
Code: [Select]
$this->bot->compre
Title: Re: Whompa Module
Post by: Alreadythere on May 16, 2007, 12:59:21 pm
Is this defined in 0.2.x?
Code: [Select]
$this->bot->compre
It's
Code: [Select]
$this->bot->commpre in both versions.
Title: Re: Whompa Module
Post by: tonyuh on May 17, 2007, 12:56:38 am
that was it.. should have spotted that.. doh! thanks!

Cheers,
Tony
Title: Re: Whompa Module
Post by: fija on May 17, 2007, 02:37:16 pm
Ok, I have a similar problem to that one that tonyuh had.

I am running bebot 0.3.4svn and have dropped the whompa.php into the cutsom/modules folder. When I do a help in the bot I cannot see the whompa command anywhere. When I try and run it in pgmsg the bot just echo's the char name that issued the command and then sends the char a tell to request help from the bot.

I am new to v3 and the new rights management system but from what I could see from the DB the minlevel for the whompa command is guest.

If you need any more info I will happy to provide what I can.

Thanks in advance

Fija
Title: Re: Whompa Module
Post by: Alreadythere on May 17, 2007, 04:50:29 pm
replace all $this -> bot -> compre with $this -> bot -> commpre I think
Title: Re: Whompa Module
Post by: fija on May 17, 2007, 05:52:28 pm
Thanks,

I'll try it when I get home. I just noticed that in the post you made the other day that there was a difference between the two commpre statements. I missed that one  :-[

I'll post back if I have probs.

Fija
Title: Re: Whompa Module
Post by: pod13 on May 18, 2007, 12:55:33 am
OOPS!  :-[

I've fixed the commpre mistake in the uploaded ZIP file.
Title: Re: Whompa Module
Post by: fija on July 27, 2007, 12:34:45 am
ok, I know its been a while since I last posted on this. There is a slight problem I came across with this module and that is that when you use the command in the pgroup the bot only returns your name. Not an org bot so I can clarify if this fix will work for that.

Quote
/*
   This gets called on a msg in the privgroup with the command
   */
   function pgmsg($name, $msg)
   {
        $this->bot->send_pgroup($name,$this->do_whompa_stuff($name, $msg));

I changed to this
Quote
/*
   This gets called on a msg in the privgroup with the command
   */
   function pgmsg($name, $msg)
   {
        $this->bot->send_pgroup($this->do_whompa_stuff($name, $msg));
   }

Note that I have removed the $name before $this->do_whompa_stuff($name, $msg));

btw this also works great in v4 of bebot ;)

Hope this helps someone.

Fija
Title: Re: Whompa Module
Post by: Metaphblade on August 14, 2007, 08:23:52 pm
in 4.0 if you do a !whompa cities  it will only display a popup with omni/neut/clan on the page, no citites next to them.
SimplePortal 2.3.7 © 2008-2024, SimplePortal