BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Wolfbiter on January 24, 2006, 04:24:23 am

Title: sql symbiants/pbs
Post by: Wolfbiter on January 24, 2006, 04:24:23 am
There was a post here somewhere (that I can't find) with a sql-based symb/pb script... if anyone is using it I've written a better .php for it.
Just load it and use "!symb bla" for a little help on how to use it.

2007-02-05
Now the script tries to match the input for bosses if there's no match for a pocketboss.
ie: "!pb tuq'usk" will return Haqa
Wont work on all bosses, for example "Chimera Driver", because the db entry is "Chimera Mornitor/Trainer/Driver".

2006-12-19 Update
Did a lot of changes for the !symb script, some parts are not the best.. but I thought of them while I was coding so only made dirty fixes.
Now the search options are "smarter".
!symb 200-230 infantry
!symb 180-200 doctor
!symb doctor head chest
!symb infantry artil chest wrist larm
etc... apart from adding professional search option you can mix all possible search options.

Search options
# - specific ql
#-# - ql range
infantry/support/... etc (inf, arti etc also works as long as they don't match professional substring - art will match martial artist for example).
head/wrist/rwrist/lwrist/chest/etc..
growing/awakening/etc - matches symb name

Not tested everything too much, so feel free to report bugs.

2006-12-21 Update
Forgot to specify engineer types for "!symb engineer"

All .sql are kept up to date by JJ

symbpb.php UPDATED 2006-12-19
symbiants.sql UPDATED 2006-07-24
pocketbosses.sql UPDATE 2006-07-24
http://www.jjones.co.uk/files/symbiants.sql UPDATED 2007-01-16
Title: Re: sql symbiants/pbs
Post by: Zacix on January 24, 2006, 12:13:03 pm
Original thread (http://bebot.link/index.php/topic,148.0.html)...written by Derroylo, modfied by Alreadythere, extra info by jj666 and helpfiles by Wanuarmi.

Also, what's the improved part? Can't really see the difference except a little more extensive search in the database which I'm not sure is needed. You should also make it a bit easier to change colors, e.g. use a classvariable, botlevel colortags or _Colors.php instead of redeclaring colortags throughout the code. Anyway, keep up the good work :)

PS! Even though I don't develop anything for BeBot anymore and thereby don't really concerns me (I do however enjoy to keep track of the community), I think BeBot need some coding standards. Best example of the "problem" would be how colors are set. From what I can see 4 methods are used throughout the different modules...plain strings directly into code, classvariables, botlevel variables ($this->bot->tell_color) and global variables (_Colors.php). Think it's needless to say that changing color of the bot is a royal pain in the ass to say the least =P Personally I think _Colors.php is the best solution (hey...I wrote the first version of it :D) and it shouldn't be too hard to customize and make work with the database. Guess it's up to Khalem and/or the community if they want to decide anything on this, but the way I see it, this community is growing a lot these days, and to prevent 2-3 "systems" on each feature, ease code readability etc etc, I think BeBot would benefit from this in the long run.

/runs back and hides
Title: Re: sql symbiants/pbs
Post by: Nogoal on January 24, 2006, 03:53:40 pm
I like to have the same colors in all bot msgs and so you don't need to modify each script. Oh and most BeBot scripts work under RINGbot with minor modifications and you're active on this forums so I guess you're a member of this community ; ).
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on January 25, 2006, 02:06:57 pm
The improved part is exactly the search possiblities. I know I prepfer being able to limit the output to just ql200-240 and such instead of having to view all.
And I do have a bad habit of coding for my use only, with hardcoded colors and such.

And the url you posted was not the original code. This uses a mysql database, whoever I got this from probably used that as a base thou. The place I got it from had one .sql for symbs and one for pbs, and not one files as Xenixa's mod.
Title: Re: sql symbiants/pbs
Post by: Alreadythere on January 25, 2006, 02:35:18 pm
Check my post on the second page, I posted a setup like that there, as I'm using it myself.

Got to test your search abilities some day, I tend to be lazy, so I only got one type of search right now :)
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on January 25, 2006, 05:15:58 pm
There it is, it's your script I wrote mine from (too lazy to rewrite some code, using your sql files).
Title: Re: sql symbiants/pbs
Post by: Zacix on January 25, 2006, 05:50:10 pm
The improved part is exactly the search possiblities. I know I prepfer being able to limit the output to just ql200-240 and such instead of having to view all.
And I do have a bad habit of coding for my use only, with hardcoded colors and such.

Indeed a nice addition to the module.

On the other part, code standards and such, you're of course entitled to do whatever you want. Hell, I'm like that myself. My point was not really directly aimed at you, but rather on BeBot community itself. Guess it was a less successful attempt at hijacking the thread/start a discussion about standards. As you pointed out, this is a nice addition to the module, and should probably be included in the main branch of BeBot (at least I'd like to see that). Problem is that it will need some rewriting because in the end we want colors to be set globally. I'm not sure who has access to SVN, but it will be a lot of double work for the ones that have to do it. Since it's no real standard for it, code contributors will use whatever suits them best, and they are completely entitled to no matter what, but it does create a fair amount of extra work to get it into BeBot branch. I just think that it would benefit all parts with some rules that people can comply to...at least in regards to workload, codestability, more features and easier development.

Think I'm done now =P
Title: Re: sql symbiants/pbs
Post by: Shelly on May 09, 2006, 07:17:01 pm
Looks like your original SQL code is mentioned in this thread http://bebot.link/index.php/topic,148.msg1332.html#msg1332

I did some searching to find it so I could use it too.
Title: Re: sql symbiants/pbs
Post by: jjones666 on June 06, 2006, 01:23:08 pm
Finally got round to trying this - very nice indeed!

Here are the updates which for the PB's and symbs which are missing from AOPocket (so far):

<links removed>

Cheers,

-jj-
Title: Re: sql symbiants/pbs
Post by: jjones666 on June 20, 2006, 03:04:20 am
Currently adding all the confirmed TNH drop symbs to our org database.  As I'm collecting the symbs, can confirm 100% which ones drop ;-)

Will post SQL as soon as complete.

Cheers,

-jj-
Title: Re: sql symbiants/pbs
Post by: Malosar on June 20, 2006, 03:23:28 pm
Currently adding all the confirmed TNH drop symbs to our org database.  As I'm collecting the symbs, can confirm 100% which ones drop ;-)

Will post SQL as soon as complete.

Cheers,

-jj-

Very nice, that would be awesome data to include :)
Title: Re: sql symbiants/pbs
Post by: jjones666 on June 29, 2006, 08:41:44 pm
<link removed>

here is the WIP sql - i seem to be added one or two every couple of days, so will post updates as frequently as I can.  remember these are confirmed drops, may be missing a few still.

enjoy!

cheers,

-jj-

p.s. i didn't add any that didn't already drop somewhere else :)
Title: Re: sql symbiants/pbs
Post by: jjones666 on July 05, 2006, 08:25:33 am
<link removed>
up to 851 symbs in DB.

I added a few more TNH drops and also duplicated a few entries where the pocketboss dropping symb was QL255 and symbs were also in TNH loot table.

Merged all my additions into one file.

Cheers,

-jj-

Title: Re: sql symbiants/pbs
Post by: jjones666 on July 06, 2006, 07:55:56 am
Updated again -

- Synced with AOpocket 020606, 220506 updates (and removed references to TNH dropping symbs on those additions as all <ql255 bosses).
- Added three more TNH only drops.

<link removed>
up to 856 symbs in DB.
Title: Re: sql symbiants/pbs
Post by: jjones666 on July 07, 2006, 07:43:46 pm
Updated again -

- Synced with Borealis' confirmed drops 250606: http://home.no/aofun/docs/TNH-symbiants_all.htm (thanks!)

<link removed>
up to 875 symbs in DB.
Title: Re: sql symbiants/pbs
Post by: Alreadythere on July 08, 2006, 10:49:27 am
Nice work :)
Title: Re: sql symbiants/pbs
Post by: jjones666 on July 12, 2006, 10:57:16 pm
Updated again -

- Added one more TNH drop.

<link removed>
up to 876 symbs in DB.
Title: Re: sql symbiants/pbs
Post by: jjones666 on July 22, 2006, 12:43:49 pm
Updated again -

- Synced with Muhandes' thread on engie forums: http://forums.anarchy-online.com/showthread.php?t=421758 (thanks!)
- Merged the two SQL files together.
- Removed a couple of TNH/<255 boss duplicates.

<link removed>
up to 870 symbs in DB.

N.B. incorrect on AOPocket:
240 LHAND CONTROL is "Shake" not "Ushqa"
270 EAR CONTROL is "Ushqa" not "Shake"
270 RARM CONTROL is "Ushqa" not "Shake"
Title: Re: sql symbiants/pbs
Post by: Khalem on July 23, 2006, 07:38:35 am
Awesome work JJ :)
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on July 23, 2006, 10:24:07 am
Updated first post with new .php and the latest .sql
Title: Re: sql symbiants/pbs
Post by: jjones666 on July 24, 2006, 02:10:23 am
Updated again -

- Added two more TNH drops (one from me, the other from Borealis).
- Merged pocketbosses.sql files together (can you update main post pls Wolfbiter as this is also needed).

http://www.jjones.co.uk/files/pocketbosses.sql
http://www.jjones.co.uk/files/symbiants.sql
up to 872 symbs in DB.

N.B. now only missing 100% confirmation on:
QL 270 Cognizant Waist Symbiant, Control Unit Aban*
QL 290 Conscious Ocular Symbiant, Extermination Unit Aban

* I added under Tailee Frees for the time being as this is the boss we think drops it.  Was confirmed by Ulna to drop from "Clan Inf Key" PB.
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on July 24, 2006, 09:41:44 am
Another update
Title: Re: sql symbiants/pbs
Post by: Plac3bo on July 26, 2006, 09:50:53 am
managed to crash it on my 3rd command ;)

!symb 260 support %

not good :) infinate loop :)
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on July 26, 2006, 01:08:42 pm
Seems you're using an older version of bebot, without the multipage fix.
See http://bebot.link/index.php/topic,234.0
Title: Re: sql symbiants/pbs
Post by: Alreadythere on July 26, 2006, 02:05:18 pm
Got one more drop for you:

Alert Thigh Artillery of Devourer of Scheol QL 205
Title: Re: sql symbiants/pbs
Post by: Khalem on July 27, 2006, 05:30:24 am
Actually, that bug can still be triggered by very very long lines of text.
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on July 27, 2006, 07:26:06 am
That too, but I tested the command on my own bot and it worked fine.
Title: Re: sql symbiants/pbs
Post by: jjones666 on August 06, 2006, 04:56:06 pm
Updated again -

- Added one more TNH drop.
- Added information from Alreadythere and removed symb from TNH drop (thanks!)

http://www.jjones.co.uk/files/symbiants.sql
up to 873 symbs in DB.
Title: Re: sql symbiants/pbs
Post by: jjones666 on August 26, 2006, 01:06:01 pm
Updated again -

- Added final TNH drop.

http://www.jjones.co.uk/files/symbiants.sql
up to 874 symbs in DB.

Apart from undiscovered symbs dropping from PB's - sql is 100% - unless i missed a few out :-)

N.B. now only missing 100% confirmation on:
QL 270 Cognizant Waist Symbiant, Control Unit Aban*

* I added under Tailee Frees for the time being as this is the boss we think drops it.  Was confirmed by Ulna to drop from "Clan Inf Key" PB.
Title: Re: sql symbiants/pbs
Post by: Xenixa on September 15, 2006, 04:02:54 pm
A suggestion for the .SQL files when you post new ones with updated info.

Change the INSERT INTO statements to REPLACE INTO. So when updates are put out you don't get loads of errors if you forget to drop the table first. REPLACE INTO compares current records and only updates rows that changed or are new. REPLACE INTO acts just like INSERT INTO if it's a new row of data(record).
Title: Re: sql symbiants/pbs
Post by: Glarawyn on September 15, 2006, 07:21:07 pm
sed s/'INSERT'/'REPLACE'/ symbiants.sql > replace-symbiants.sql

:)
Title: Re: sql symbiants/pbs
Post by: redmagician on September 18, 2006, 01:39:12 am
I'm not sure if this has been mentioned before but the module doesnt handle a command prefix starting with a \

The bot I run uses the command prefix "\." This made .symb send back \.pb links instead of .pb

Hopefully this isnt too sloppy but its the best I could come up with as a 'fix' right now. I would've wanted a 'cleaner' way to hide the if statement but I'm out of practice :(
Code: [Select]
function make_chatcommand($link, $title) {
$new_commpre = $this->bot->commpre;
if(substr_compare($new_commpre, '\\', 1))
$new_commpre = substr($new_commpre, 1);
return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$new_commpre.$link.'\'>' . $title . '</a>';
}

To replace this line at the end
Code: [Select]
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$this->bot->commpre.$link.'\'>' . $title . '</a>';}
Title: Re: sql symbiants/pbs
Post by: Malosar on September 18, 2006, 02:34:57 am
A backslash is a very bad idea for a prefix because of the way php and linux process a backslash. I would advise choose another prefix otherwise your going to run into more trouble later.
Title: Re: sql symbiants/pbs
Post by: Khalem on September 18, 2006, 10:02:55 pm
The backslash is required since the prefix is used in rexexp matching, hence just "." will break, you need to escape it using \.

I'll probably have a proper look at this when i find the time to merge it into trunk.
Title: Re: sql symbiants/pbs
Post by: kuznechik on September 19, 2006, 12:12:55 pm
Maybe it's possible to make it true regexp? So we can have multiple prefixes allowed.
Title: Re: sql symbiants/pbs
Post by: Glarawyn on September 19, 2006, 05:43:06 pm
Maybe it's possible to make it true regexp? So we can have multiple prefixes allowed.

Not sure what you're trying to say. The issue is that \ and . are used as part of regular expressions. If you are trying to match \ and . in a regular expression, you have to escape them using and extra backslash. \\ matches \ and \. matches .


There are 11 characters with special meanings in regular expressions: the opening square bracket [, the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening round bracket ( and the closing round bracket ). These special characters are often called "metacharacters".

It is probally a good idea to just not use regex metacharacters as your command prefix. I don't know if escapting the characters in your configuration file will work...
Title: Re: sql symbiants/pbs
Post by: Khalem on September 19, 2006, 07:29:50 pm
On a side note. I am likely going to drop the use of regexp for command prefixes for 0.5/0.6 along with the other plugin and hook changes which will include moving a few things out of the plugins control (for better or worse), and at the same time allow a plugin to override so that a command can be used without a prefix.

Multiple prefixes are a bad idea for preformance reasons. For each additional prefix to check for you in effect double the amount of work the bot has to do on every single message it sees. And this is a place in the code where i want it to be as efficient as possible simply because it is what the bot spends most of its time doing.
Title: Re: sql symbiants/pbs
Post by: jjones666 on October 31, 2006, 12:19:10 am
Updated again -

- Added 280 infantry eye (oops!)
- Corrected QL error on 1 entry

http://www.jjones.co.uk/files/symbiants.sql
up to 875 symbs in DB.

Apart from undiscovered symbs dropping from PB's - sql is 100% - unless i missed a few out :-)

N.B. now only missing 100% confirmation on:
QL 270 Cognizant Waist Symbiant, Control Unit Aban*

* I added under Tailee Frees for the time being as this is the boss we think drops it.  Was confirmed by Ulna to drop from "Clan Inf Key" PB.
Title: Re: sql symbiants/pbs
Post by: Bart on December 16, 2006, 06:55:47 am
ok still a bebot noob..... I imported to mysql (db for the guildbot) but keep getting "Not found" on everyone I search... any ideas on how I am messing up?



Bart
Title: Re: sql symbiants/pbs
Post by: jjones666 on December 16, 2006, 10:58:07 am
Did you import both databases?

-jj-
Title: Re: sql symbiants/pbs
Post by: Bart on December 16, 2006, 07:14:39 pm
yeah

When I try to look at the DB this is what I get.


(http://img4.picsplace.to/img4/27/thumbs/sql.JPG) (http://img4.picsplace.to/img.php?file=img4/27/sql.JPG)

Not sure if that makes any difference.
Title: Re: sql symbiants/pbs
Post by: Bart on December 17, 2006, 10:44:53 am
ok I was thinking maybe I shouldn't be importing wiht a GUI, does anyone know the line command version?
Title: Re: sql symbiants/pbs
Post by: Malosar on December 17, 2006, 02:32:19 pm
source blahblah.sql
Title: Re: sql symbiants/pbs
Post by: Gilfar on December 19, 2006, 11:30:15 am
ok I was thinking maybe I shouldn't be importing wiht a GUI, does anyone know the line command version?

First and foremost, before importing data (or doing anything with your database that can potentially damage your existing data) take a backup. Yes, I know.. I know.. where's the excitement if you have a backup?

For the backup, do:

mysqldump -uusername databasename -p > backup.sql

Hitting enter and you'll be prompted for your password.

So if you have a mysql username that is 'leet' with a database named 'symbiants' it would be...

mysqldump -uleet symbiants -p > backup.sql

What happens here is that mysqldump will create a backup of the database 'symbiants.sql' into a file named 'backup.sql' which it'll create in the same directory you're in.

You guessed it, there are more fancy ways of doing this but the above command gets the job done.

Armed with our backup we can now continue on with our efforts to deliberately destroy import data to our database with the following:

mysql -uusername databasename -p < import.sql

Still using our example from above..

mysql -uleet symbiants -p < import.sql

Hitting enter, you'll be promted with "Enter password:" when the correct password has been entered, there won't be much happening on the screen given everything works out. It'll only prompt you with error messages etc., but what are the odds that that will happen and besides, that's a completely different question than what I'm trying to answer.

On the screenshot you provided I noticed you've already got Apache running and odds are that you've got PHP too. Therefore, I would warmly recommend having a look at phpmyadmin over at http://www.phpmyadmin.net/

It's not as fancy as the GUI tools you may be used to, but it's not so flashy that it gets in your way.

Hope that helps.

Sincerely,
Gilfar
Title: Re: sql symbiants/pbs
Post by: Bart on December 19, 2006, 09:24:14 pm
I got it, The GUI didn't work correctly...
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on December 20, 2006, 01:43:20 am
Updated the script itself, check first post for info
Title: Re: sql symbiants/pbs
Post by: Malosar on December 20, 2006, 02:05:08 pm
Nice updates, thanks!
Title: Re: sql symbiants/pbs
Post by: pusikas on December 21, 2006, 03:19:15 am
Just installed it, and the examples you gave in the first post worked nicely. But when I slightly change it, for example:
!symb 180-200 engineer
Then I don't get engie symbs (which would be only control symbs) but all kinds of symbs. All in the correct QL range, tho.
!symb 180-200 eng
produces the same result...
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on December 21, 2006, 04:39:03 am
That's because I forgot to add which type of symbs engineer can use... updating first post
Title: Re: sql symbiants/pbs
Post by: pusikas on December 21, 2006, 06:35:41 pm
Thanks, works now.
Title: Re: sql symbiants/pbs
Post by: MatHack on December 26, 2006, 02:19:51 am
"!symbs shade" will cause the bot to spam all symbs. Removing shade from the proflist fixed this.
Title: Re: sql symbiants/pbs
Post by: lonillen on January 01, 2007, 12:37:47 am
couple of symbs update:

Vital Right Arm Symbiant, Extermination Unit Aban off Aray QL 210
Cognizant Feet Symbiant, Support Unit Aban off Ahpta QL 220
Excited Left Arm Symbiant, Extermination Unit Aban off The Worm King QL 202
Excited Right Arm Symbiant, Extermination Unit Aban off The Worm King QL 202
Title: Re: sql symbiants/pbs
Post by: Nogoal on January 01, 2007, 09:02:53 pm
- Effective Ear Symbiant, Support Unit Aban

Dropped from TNH
Title: Re: sql symbiants/pbs
Post by: jjones666 on January 03, 2007, 02:21:22 am
- Effective Ear Symbiant, Support Unit Aban

Dropped from TNH

It is assumed all symbs QL 180+ can drop from TNH - where they are available from other known PB's I don't add to the SQL.  The only duplications occur where the PB is QL 255 (obviously a pain in the butt to get the crystals to pop).

-jj-
Title: Re: sql symbiants/pbs
Post by: jjones666 on January 03, 2007, 02:22:23 am
Updated again -

- Added information from Loni and removed symbs from TNH drop (thanks!)

<LINK REMOVED>
up to 875 symbs in DB.

Many thanks Wolfbiter for the updated script by the way!
Title: Re: sql symbiants/pbs
Post by: pusikas on January 16, 2007, 05:21:46 am
Did a few pobos today. The following is missing in the database:
The Elysian Soul Dredge QL 90 dropped Operative Thigh Symbiant, Artillery Unit Aban (ql110)
(doubt anyone cares  ;D )
Title: Re: sql symbiants/pbs
Post by: jjones666 on January 16, 2007, 09:25:18 am
Updated again -

- Added information from Pusikas (thanks!)

<LINK REMOVED>
up to 876 symbs in DB.

(That one was in AOPocket so not sure how it was missed ;D)
Title: Re: sql symbiants/pbs
Post by: Alreadythere on January 18, 2007, 08:58:01 am
Cognizant Chest Support has a wrong ID, it points to vital left wrist control.

Correct ID is 236141.
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on February 05, 2007, 06:02:28 am
updated
Title: Re: sql symbiants/pbs
Post by: jjones666 on February 13, 2007, 12:29:20 am
Updated again -

- Added information from Alreadythere (thanks!)
- Added QL160 Artillery Foot.

http://www.jjones.co.uk/files/symbiants.sql
up to 877 symbs in DB.

-jj-
Title: Re: sql symbiants/pbs
Post by: Dabaron on February 13, 2007, 08:07:45 am
I ran into a strange issue with this module.  One of the bots I host uses + for their prefix (yeah, irritates me but whatever).  When I do the +symbs command it works perfectly until I go to click on the pb's name under the symb name, its adding a / in front of the command (/tell cbot1 /+pb Churn).  This exact same thing works fine in all my other bots.  I tested by changing the prefix to - instead of + (since you have to use /+ in the bot.conf file to use a +) and it makes everything work fine.  Any ideas on how to tweak this for that one strange bot?
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on February 13, 2007, 09:56:27 am
\ is the escape char, not /
Title: Re: sql symbiants/pbs
Post by: Malosar on February 19, 2007, 04:02:53 pm
Updated the sql to include the latest info on the 255 pocketbosses and the symbiant drops.
Title: Re: sql symbiants/pbs
Post by: jjones666 on February 19, 2007, 05:58:24 pm
Was this obtained from that German page or somewhere else?

Cheers,

-jj-
Title: Re: sql symbiants/pbs
Post by: Malosar on February 19, 2007, 08:42:38 pm
Yeah that german page that was linked recently.
Title: Re: sql symbiants/pbs
Post by: Dabaron on February 20, 2007, 01:18:24 am
\ is the escape char, not /

I meant \ but typed it wrong in here, its right in the .conf file   :P

Any other ideas?
Title: Re: sql symbiants/pbs
Post by: Wolfbiter on February 20, 2007, 10:23:07 am
Code: [Select]
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$this->bot->commpre.$link.'\'>' . $title . '</a>';}
Try replacing that with
Code: [Select]
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell <pre>'.$link.'\'>' . $title . '</a>';}
SimplePortal 2.3.7 © 2008-2024, SimplePortal