BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.5 support => Topic started by: Dracutza on April 01, 2008, 03:28:04 am

Title: multibot, one dir; preferences
Post by: Dracutza on April 01, 2008, 03:28:04 am
the very same preferences file that more or less works on 4 other bots errors out on a 5th

Quote
bot [2008-04-01 01:28:19]      [TELL]  [INC]   Dracutza: preferences

Warning: array_keys(): The first argument should be an array in P:\bot\modules\Preferences.php on line 77

Warning: Invalid argument supplied for foreach() in P:\bot\modules\Preferences.php on line 78

restarted bots and server. dumped that bots preferences tables and still get same error.
Title: Re: multibot, one dir; preferences
Post by: Dracutza on April 01, 2008, 03:43:36 am
i see what the problem is.

where each bot got it's own preferences and preferences_def tables with the old preferences file, now with the new one there is just one global preferences and preferences_def table created.

Title: Re: multibot, one dir; preferences
Post by: Blueeagle on April 01, 2008, 11:33:29 am
This is related to the fact that someone figured storing a true/false value was best done with a VARCHAR(10) and not a BOOL (or TINYINT(1)).

Change the call to $this -> bot -> db -> define_tablename("preferences_def", true); to read $this -> bot -> db -> define_tablename("preferences_def", "true");

This code should be changed as storing a boolean value in a VARCHAR(10) is just plain stupid. :)
Title: Re: multibot, one dir; preferences
Post by: Dracutza on April 01, 2008, 06:36:57 pm
tried that and no luck.

same error and still a global pref table
Title: Re: multibot, one dir; preferences
Post by: Blueeagle on April 02, 2008, 01:39:57 am
After you do that you need to remove or edit the reference in the master table name registry.

The easiest way to do this is to drop the tablenames table as defaults are created if it doesn't exist.
Title: Re: multibot, one dir; preferences
Post by: Dracutza on April 03, 2008, 03:57:48 am
ok 3 of 5 is not bad... can you explain why the other two throw the same error still?

They are just dumb bots atm, so I just dumped all the tables related to those two bots, deleted the ini files for each bot, and then restarted.

Quote
bot1 [2008-04-03 01:32:59]    [TELL]  [INC]   Dracutza: preferences
bot1 [2008-04-03 01:32:59]    [TELL]  [OUT]   -> Dracutza: [link]Preferences[/link]
Quote
bot2 [2008-04-03 01:32:59]    [TELL]  [INC]   Dracutza: preferences
bot2 [2008-04-03 01:32:59]    [TELL]  [OUT]   -> Dracutza: [link]Preferences[/link]

Quote
bot4 [2008-04-03 01:57:47]      [TELL]  [INC]   Dracutza: !preferences

Warning: array_keys(): The first argument should be an array in P:\bot\modules\Preferences.php on line 77

Warning: Invalid argument supplied for foreach() in P:\bot\modules\Preferences.php on line 78
bot 4[2008-04-03 01:57:47]      [TELL]  [OUT]   -> Dracutza: [link]Preferences[/link]
SimplePortal 2.3.7 © 2008-2025, SimplePortal