collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: sql symbiants/pbs  (Read 20808 times)

0 Members and 1 Guest are viewing this topic.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #30 on: September 15, 2006, 07:21:07 pm »
sed s/'INSERT'/'REPLACE'/ symbiants.sql > replace-symbiants.sql

:)

Offline redmagician

  • BeBot Rookie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #31 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>';}
« Last Edit: September 18, 2006, 01:40:55 am by redmagician »

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: sql symbiants/pbs
« Reply #32 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.
Eternalist
General of The Syndicate

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: sql symbiants/pbs
« Reply #33 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.
BeBot Founder and Fixer Kingpin

Offline kuznechik

  • Contributor
  • *******
  • Posts: 60
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #34 on: September 19, 2006, 12:12:55 pm »
Maybe it's possible to make it true regexp? So we can have multiple prefixes allowed.
Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #35 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...

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: sql symbiants/pbs
« Reply #36 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.
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #37 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.

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #38 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
« Last Edit: December 16, 2006, 08:30:13 am by Bart »

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #39 on: December 16, 2006, 10:58:07 am »
Did you import both databases?

-jj-

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #40 on: December 16, 2006, 07:14:39 pm »
yeah

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




Not sure if that makes any difference.
« Last Edit: December 16, 2006, 07:36:30 pm by Bart »

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #41 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?

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: sql symbiants/pbs
« Reply #42 on: December 17, 2006, 02:32:19 pm »
source blahblah.sql
Eternalist
General of The Syndicate

Offline Gilfar

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #43 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

Offline Bart

  • BeBot User
  • **
  • Posts: 39
  • Karma: +0/-0
Re: sql symbiants/pbs
« Reply #44 on: December 19, 2006, 09:24:14 pm »
I got it, The GUI didn't work correctly...

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 685
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal