L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 12:09:31 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: sql symbiants/pbs
Pages: 1 2 [3] 4 5   Go Down
« previous next »
Print
Author Topic: sql symbiants/pbs  (Read 8078 times)
0 Members and 1 Guest are viewing this topic.
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: sql symbiants/pbs
« Reply #30 on: September 15, 2006, 12:21:07 PM »

sed s/'INSERT'/'REPLACE'/ symbiants.sql > replace-symbiants.sql

Smiley
Logged
redmagician
Freshman
*
Offline Offline

Posts: 7


Re: sql symbiants/pbs
« Reply #31 on: September 17, 2006, 06:39:12 PM »

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 Sad
Code:
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:
function make_chatcommand($link, $title) {return '<a href=\'chatcmd:///tell '.$this->bot->botname.' '.$this->bot->commpre.$link.'\'>' . $title . '</a>';}
« Last Edit: September 17, 2006, 06:40:55 PM by redmagician » Logged
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: sql symbiants/pbs
« Reply #32 on: September 17, 2006, 07:34:57 PM »

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.
Logged

Eternalist
General of The Syndicate
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: sql symbiants/pbs
« Reply #33 on: September 18, 2006, 03: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.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
kuznechik
BeBot Contributor
Rookie
*******
Offline Offline

Gender: Male
Posts: 60



Re: sql symbiants/pbs
« Reply #34 on: September 19, 2006, 05:12:55 AM »

Maybe it's possible to make it true regexp? So we can have multiple prefixes allowed.
Logged

Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: sql symbiants/pbs
« Reply #35 on: September 19, 2006, 10:43:06 AM »

Quote from: kuznechik on September 19, 2006, 05:12:55 AM
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...
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: sql symbiants/pbs
« Reply #36 on: September 19, 2006, 12: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.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: sql symbiants/pbs
« Reply #37 on: October 30, 2006, 06:19:10 PM »

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.
Logged
Bart
Rookie
**
Offline Offline

Posts: 39


Re: sql symbiants/pbs
« Reply #38 on: December 16, 2006, 12: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, 02:30:13 AM by Bart » Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: sql symbiants/pbs
« Reply #39 on: December 16, 2006, 04:58:07 AM »

Did you import both databases?

-jj-
Logged
Bart
Rookie
**
Offline Offline

Posts: 39


Re: sql symbiants/pbs
« Reply #40 on: December 16, 2006, 01: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, 01:36:30 PM by Bart » Logged
Bart
Rookie
**
Offline Offline

Posts: 39


Re: sql symbiants/pbs
« Reply #41 on: December 17, 2006, 04:44:53 AM »

ok I was thinking maybe I shouldn't be importing wiht a GUI, does anyone know the line command version?
Logged
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: sql symbiants/pbs
« Reply #42 on: December 17, 2006, 08:32:19 AM »

source blahblah.sql
Logged

Eternalist
General of The Syndicate
Gilfar
Freshman
*
Offline Offline

Posts: 8


Re: sql symbiants/pbs
« Reply #43 on: December 19, 2006, 05:30:15 AM »

Quote from: Bart on December 17, 2006, 04:44:53 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
Logged
Bart
Rookie
**
Offline Offline

Posts: 39


Re: sql symbiants/pbs
« Reply #44 on: December 19, 2006, 03:24:14 PM »

I got it, The GUI didn't work correctly...
Logged
Pages: 1 2 [3] 4 5   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: sql symbiants/pbs
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 17
Total: 21
xlDanek
Temar
Stealth
gerborg

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.246 seconds with 29 queries. (Pretty URLs adds 0.041s, 4q)
Loading...