BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: KingJ on March 31, 2006, 03:41:33 pm
-
Restared the bot, looked at the bot window and saw an error
MySQL error (# 0) on query: INSERT IGNORE INTO settings (setting, value) VALUES
('highlight_1', 'CB11C9>)
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ''CB11C9>)' at line 1
This is the entire login / loading sequence (including error):
Connected to MySQL
[2006-03-31 13:25:04] [CORE] [LOAD] Admin.php
[2006-03-31 13:25:04] [CORE] [LOAD] Alts.php
[2006-03-31 13:25:04] [CORE] [LOAD] BotHelp.php
[2006-03-31 13:25:04] [CORE] [LOAD] Online.php
[2006-03-31 13:25:04] [CORE] [LOAD] Que.php
[2006-03-31 13:25:04] [MOD] [LOAD] About.php
[2006-03-31 13:25:04] [MOD] [LOAD] AlienAttack_GUILD.php
[2006-03-31 13:25:04] [MOD] [LOAD] AutoInv.php
[2006-03-31 13:25:04] [MOD] [LOAD] AutoMsg.php
[2006-03-31 13:25:04] [MOD] [LOAD] Bid.php
[2006-03-31 13:25:04] [MOD] [LOAD] Bio.php
[2006-03-31 13:25:04] [MOD] [LOAD] Calc.php
[2006-03-31 13:25:04] [MOD] [LOAD] Callers.php
[2006-03-31 13:25:04] [MOD] [LOAD] Countdown.php
[2006-03-31 13:25:04] [MOD] [LOAD] GuildRelay_GUILD.php
[2006-03-31 13:25:04] [MOD] [LOAD] IRC.php
[2006-03-31 13:25:04] [MOD] [LOAD] Is.php
[2006-03-31 13:25:04] [MOD] [LOAD] Items.php
[2006-03-31 13:25:04] [MOD] [LOAD] Lag.php
[2006-03-31 13:25:04] [MOD] [LOAD] Level.php
[2006-03-31 13:25:04] [MOD] [LOAD] Logon_GUILD.php
[2006-03-31 13:25:04] [MOD] [LOAD] MassMsg.php
[2006-03-31 13:25:04] [MOD] [LOAD] News.php
[2006-03-31 13:25:04] [MOD] [LOAD] Oe.php
[2006-03-31 13:25:04] [MOD] [LOAD] Points.php
MySQL error (# 0) on query: INSERT IGNORE INTO settings (setting, value) VALUES
('highlight_1', 'CB11C9>)
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ''CB11C9>)' at line 1
[2006-03-31 13:25:04] [MOD] [LOAD] PrivGroup.php
[2006-03-31 13:25:04] [MOD] [LOAD] Raffle.php
[2006-03-31 13:25:04] [MOD] [LOAD] RaidTime.php
[2006-03-31 13:25:04] [MOD] [LOAD] Rally.php
[2006-03-31 13:25:05] [MOD] [LOAD] Relay_GUILD.php
[2006-03-31 13:25:05] [MOD] [LOAD] Roll.php
[2006-03-31 13:25:05] [MOD] [LOAD] Rooster_GUILD.php
[2006-03-31 13:25:05] [MOD] [LOAD] Server.php
[2006-03-31 13:25:05] [MOD] [LOAD] Shutdown.php
[2006-03-31 13:25:05] [MOD] [LOAD] Target.php
[2006-03-31 13:25:05] [MOD] [LOAD] Time.php
[2006-03-31 13:25:05] [MOD] [LOAD] TowerAttack.php
[2006-03-31 13:25:05] [MOD] [LOAD] Whois.php
[2006-03-31 13:25:05] [LOGIN] [STATUS] Connecting
[2006-03-31 13:25:06] [LOGIN] [STATUS] Authenticateing
[2006-03-31 13:25:06] [LOGIN] [STATUS] Logging in
[2006-03-31 13:25:06] [LOGIN] [RESULT] OK
I am running MySQL 5.0.3 Beta NTwith the php binaries included with bot.
Is this supposed to happen?
-
Because you typo'd on the SQL.
Should read:
INSERT IGNORE INTO settings (setting, value) VALUES ('highlight_1', 'CB11C9')
-
Ok, fixed that. Now I get this error further down:
[2006-03-31 18:03:57] [MOD] [LOAD] Rally.php
MySQL error (# 0) on query: ALTER IGNORE TABLE guests ADD COLUMN name VARCHAR(25
) NOT NULL AFTER id
Duplicate column name 'name'
MySQL error (# 1) on query: ALTER IGNORE TABLE guests ADD COLUMN timeadd INT NOT
NULL AFTER name
Duplicate column name 'timeadd'
MySQL error (# 2) on query: ALTER IGNORE TABLE guests ADD COLUMN addby VARCHAR(2
5) NOT NULL AFTER timeadd
Duplicate column name 'addby'
[2006-03-31 18:03:57] [MOD] [LOAD] Relay_GUILD.php
These errors appear to be appearing in modules which I downloaded off here
Edit: Upon sumbitting news, I got this error in the bot (and the news didn't submit).
[2006-03-31 18:07:50] [TELL] [INC] Soleeet: news If you have lowbie alts, p
lease level them to get our org's average level up. The average level as of 31st
March is: 38
MySQL error (# 0) on query: INSERT INTO news (id, name, news) VALUES (1143828470
, 'Soleeet', 'If you have lowbie alts, please level them to get our org's averag
e level up. The average level as of 31st March is: 38')
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 's average level up. The a
verage level as of 31st March is: 38')' at line 1
[2006-03-31 18:07:50] [TELL] [OUT] -> Soleeet: News has been added.[/news]
Think I might upgrade from 5.0.3 beta to 5 Stable, see if that helps.
Edit2: Upgrade didn't help with the errors, wasn't expecting it to though.
-
'If you have lowbie alts, please level them to get our org's average level up. The average level as of 31st March is: 38'
Should be:
'If you have lowbie alts, please level them to get our org\'s average level up. The average level as of 31st March is: 38'
You're using the ' in too many places, it exits the SQL query :)
-
Would it be possible to get the developers to add in automatic / insertion?
Thanks for your help so far :)
-
No, any SQL that you do has to be done according to SQL standards :p
You could also do:
$varname = addslashes("If you have lowbie alts, please level them to get our org's average level up. The average level as of 31st March is: 38");
Or if you're getting the info from a command,
$varname = addslashes($msg);
Then inside the sql, just put '" . $varname . "' and that will add the fixed $msg.
-
For the ALTER IGNORE errors please read the commented code near the top in Relay_GUILD.php
Specifically: // Comment out the 4 lines above if the columns already exsist.
For the News issue the function that insterts should look like this:
function set_news($name, $msg, $type)
{
if ($this -> bot -> guildbot || $this -> bot -> admin -> in_group($name, "admin"))
{
$this -> bot -> db -> query("INSERT INTO news (type, time, name, news) VALUES ('" . $type . "', " . time() .
", '" . $name . "', '" . addslashes($msg) . "')");
return "Thank you ".$name." your entry has been submitted.";
}
else
return "You must be an Admin to do this";
}
Note the addslashes($msg) in that bit of code.
-
Ok, i'll try this out tomorrow (its getting a bit late over here) but before that I have another error for you to ponder over.
If the bot restarts (Manually through restart or because of connection loss), the bot does not actually restart. It will terminate and then run 'pause' in the cmd window which causes the message "Press Any Key to Continue..." in the cmd window. This causes the bot not to restart but sit there with a cmd window waiting for my input. I then have to execute the start.bat script again to get it working. At times, my internet can be quite unreliable and disconnect a few times per day. However, since it does not restart the bot is still unavailable even when it is back up again and requires user input.
Looking at the start.bat file, I see this
@cls
@php -c ./ Main.php
pause
Surely putting pause into it dosen't do it much good but even if I took it out the window would terminate completely (and still not restart). Surely it is possible to get it to loop? I know very little batch file scripting and unfortunatly have no idea how to do loops in batch files. Any help would be appreciated.
Thanks again for all your help so far!
-
Solved the start.bat problem, modified batch file is below:
:RUNBOT
@cls
@php -c ./ Main.php
GOTO RUNBOT
-
I think bebot already has a loop like that in one of the php files and that batch file is 'working as intended'