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
-
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
-
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
-
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 ; ).
-
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.
-
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 :)
-
There it is, it's your script I wrote mine from (too lazy to rewrite some code, using your sql files).
-
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
-
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.
-
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-
-
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-
-
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 :)
-
<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 :)
-
<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-
-
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.
-
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.
-
Nice work :)
-
Updated again -
- Added one more TNH drop.
<link removed>
up to 876 symbs in DB.
-
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"
-
Awesome work JJ :)
-
Updated first post with new .php and the latest .sql
-
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.
-
Another update
-
managed to crash it on my 3rd command ;)
!symb 260 support %
not good :) infinate loop :)
-
Seems you're using an older version of bebot, without the multipage fix.
See http://bebot.link/index.php/topic,234.0
-
Got one more drop for you:
Alert Thigh Artillery of Devourer of Scheol QL 205
-
Actually, that bug can still be triggered by very very long lines of text.
-
That too, but I tested the command on my own bot and it worked fine.
-
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.
-
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.
-
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).
-
sed s/'INSERT'/'REPLACE'/ symbiants.sql > replace-symbiants.sql
:)
-
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 :(
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
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$this->bot->commpre.$link.'\'>' . $title . '</a>';}
-
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.
-
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.
-
Maybe it's possible to make it true regexp? So we can have multiple prefixes allowed.
-
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...
-
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.
-
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.
-
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
-
Did you import both databases?
-jj-
-
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.
-
ok I was thinking maybe I shouldn't be importing wiht a GUI, does anyone know the line command version?
-
source blahblah.sql
-
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
-
I got it, The GUI didn't work correctly...
-
Updated the script itself, check first post for info
-
Nice updates, thanks!
-
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...
-
That's because I forgot to add which type of symbs engineer can use... updating first post
-
Thanks, works now.
-
"!symbs shade" will cause the bot to spam all symbs. Removing shade from the proflist fixed this.
-
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
-
- Effective Ear Symbiant, Support Unit Aban
Dropped from TNH
-
- 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-
-
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!
-
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 )
-
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)
-
Cognizant Chest Support has a wrong ID, it points to vital left wrist control.
Correct ID is 236141.
-
updated
-
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-
-
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?
-
\ is the escape char, not /
-
Updated the sql to include the latest info on the 255 pocketbosses and the symbiant drops.
-
Was this obtained from that German page or somewhere else?
Cheers,
-jj-
-
Yeah that german page that was linked recently.
-
\ is the escape char, not /
I meant \ but typed it wrong in here, its right in the .conf file :P
Any other ideas?
-
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$this->bot->commpre.$link.'\'>' . $title . '</a>';}
Try replacing that with
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell <pre>'.$link.'\'>' . $title . '</a>';}