BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Khalem on September 08, 2005, 05:31:10 am

Title: Bebot 0.3.x Development [release 0.3.5]
Post by: Khalem on September 08, 2005, 05:31:10 am
Development releases:
Please be warned that this is not a stable release codebase. If you are not familiar with MySQL and know how to edit your database DO NOT USE THIS RELEASE.
The codebase works for me without issues (unless otherwise stated in the changelog), but that doesnt mean it will work just fine for you.
The next stable release will be 0.4.0, again see changelog for details on version numbering convention.

Report issues and discuss this release in this thread.

Downloads:
[BeBot 0.3.5 Zip Archive (http://bebot.link/index.php?action=tpmod;dl=item11)]
[BeBot 0.3.5 Tar.gz Archive (http://bebot.link/index.php?action=tpmod;dl=item10)]

The php bundle have been split into its own branch as its only needed by windows users, and it will generally be updated less often than the bot core.
[PHP Bundle (http://bebot.link/index.php?action=tpmod;dl=item9)]

You can also get the latest and greatest directly from the subversion repository using a subversion client.
Repository is located at: http://svn.shadow-realm.org/svn/BeBot/
You can also browse the repository at http://svn.shadow-realm.org/
Example using the linux command line client:
Code: [Select]
svn co http://svn.shadow-realm.org/svn/BeBot/trunk BeBot

Please note that the code in the repository might not always be functional, but usually the repository should contain functional, although untested code.

Changelog:

-------------
Version 0.3.5
-------------
- added missing default access rights
- added ban manager module to handle bans outside of blacklisting
- added banned_for and banned_until fields to user table (table gets updated automatically) for more flexible bans
- added optional informative message telling how to disable autoinvite to automatically invited characters
- user group(s) which should be per default marked for autoinvite on adding can be selected (none, members, guests, both)
- only setting defaults for receive_* if new user is guest or member, no longer for anonymous users
- Allow users to remove deleted characters from their alt lists.
- Check that the character we are checking alts for actually exsists.
- Fixed several issues with flexible security.
- Help updated for all modules that needed it.
- The Say module now outputs to the correct channels.
- The bot command character is now optional in tells, behaviour can be controlled by settings.
- Some minor fixes to AOChat library to deal with issues on certain PHP versions.
- Global settings array removed, replaced by $this -> bot -> settings -> get($module, $setting).
- Settings functions are now accessed via $this -> bot -> settings -> function() instead of $this -> bot -> set -> function()
- added pseudo-channel "all" to accesscontrol -> create(), to set rights for tell, pgmsg and gc at once
- Extended $this -> bot -> send_help() to accept an optinal command paramater.
- Legacy security checks removed from all modules.
- Security.php, Settings.php, and AccessControl.php are loaded before all other modules to satisfy dependencies.
- added $command["tells"] to catch any unhandled tells if wanted
- Raid roster properly using notitify field instead of user_level for buddy list
- fixed broken [whois] in memberslist
- removed defunct custom/help/ folder
- Extened functionality of running mutiple bots out of a single directory structure to allow per bot MySQL configurations.
- An "official" branch to improve BeBot 0.4 raidbot functionality was created.
- showing alts and blacklist info can be disabled by settings now
- Updated $this -> table_suffix to $this -> table_prefix (now if there is no prefix specified in MySQL.conf, it defaults to botname_tablename).
- Updated license to disallow redistributing BeBot under GPL versions other than version 2.
- Added option to enable/disable security for the Alts command. This will prevent you from adding alts with higher access level than you if Security -> usealts is enabled.
  It will also prevent you from using alts admin to add alts to someone with higher access level than yourself. Defaults to on for security reasons. Contributed by Chris96
- Removed non alt related info from fancy alts output (make_info_blob).
- Added optional parameter to show_alt function to allow returning of results without creating a chat_blob.
- Added option to enable a detailed whois view instead of the old Alts window. Enabled by default.
- Added options to display links and options in detailed whois view.
- Added make_chatcommand to Bot.php to allow for easy creation of chat command links. Moved from ShortCutsGUI.
- Fixed a bug in IRC relay where we would unset the wrong cronjob upon disabling IRC relay.
- Fixed a bug in the tablename cache causing excessive queries.
- Added a trigger check to see if we needed to check the database in Logon_Notifies to avoid uneccecary database queries.
- Disabled AutoMessage module by default as it is not needed for most people and only adds uneccecary database queries.
- Moved lastseen update from core/Roster.php to core/OnlineDB.php to keep online tracking in one core module.
- Roster update is now only run on startup if more than 6 hours passed since the last successfull update.
- Make sure we ignore output from the bot itself.
- Ignoring bot output from pgroup and gmsg channels now, no need to handle bot output as input again.
- Added global FormatString for gmdate() calls throughout the bot as setting.
- Added info about existing last_seen entries to !is output.
- Moved cronjobs of BanManager and Blacklist modules from 1min to 5min intervals.
- Added option to disable logon spam entirely.
- Caching all queries for alts and mains.


-------------
Version 0.3.4
-------------
Important:
===============================================================================
- Important note for module developers
  Due to character id's now being 2^31 in size and how the bot deals with this, you must remember to use the int_to_string and string_to_int whenever
  you want to work with the "real" character id's. Internally the bot will happily churn on using overflowed integers that goes negative.
  Remember also to convert any "real" character id's back to an overflowed integer before passing something back to the bot to handle internally.
  Database entries will be stored with the overflowed integer value, NOT the "real" character id's.
 
- This version adds tablename prefix support:
  - Add new configuration entries to MySQL.conf
  - You MUST manually alter the tablenames before starting this version or start with an empty database.
    Alternatively you can set the prefix to be blank.
  - ALL MySQL queries must be updated in custom modules to make use of table prefixes.
    Table names should now be referenced as: #___name where #___ will automatically be replaced with
    the correct prefix by the bot during runtime.
- Bot.php, MySQL.php and AOCHAT.php have been moved into the subdirectory Sources.
  Please take care to remove the old files in the root directory after upgrading if installing to
  the same directory.
- main.php has been renamed Main.php.
- start.php has been renamed StartBot.php.
- start.bat has been renamed StartDebugBot.bat.
- StartBot.bat has been added and will allow the bot to automatically reconnect if disconnected or crashed.
- Rooster_GUILD.php and Rooster_RAID.php have been renamed to Roster.php and is now a core module.
  Be sure to disable/remove the old Rooster_* modules.
- _Colors.php renamed to Colors.inc, _TeamsClass.php renamed to Teams.inc.
- The function $this -> bot -> get_site has been completely rewritten
  with inspiration by ShadowGod's AOXML class and php.net comments:
  - The likelyhood of get_site causing the bot to hang should be eliminated completely now.
    The timeout has been reduced to 20 seconds total and can be overridden using additional parameters.
  - The function will now return full error messages allowing plugins that use it to return
    more sensible errors to the end users (Whois plugin is a good example)
  - The return data has changed from a string to an array. See Bot.php headers for details.
- The bot now has a built in whois function with cache, the function is $this -> bot -> whois -> lookup,
  written mainly by Alreadythere.
  See core/WhoisCache.php headers for more information.
- Que.php has been renamed to Queue.php and all its functions and variables has been renamed accordingly.
- The directories custom/modules/, custom/core/ and custom/help will now also be read by the bot on startup allowing
  separation between original and custom modules for the bot along with help files.
- News.php has gotten settings that are configurable by the new settings module
- MassMsg.php has gotten a setting that is configurable by the new settings module
- Alts.php has gotten new (optional) fancy output
===============================================================================

- Bot now consistantly uses long opening tags in all files.
- Fixed a crash in AlienAttack_GUILD module triggered if the bot had not witnessed any city events.
  Reported by Dabaron @ BeBot Forum.
- Fix a bug causing the wrong faction to be written to the database for tower war outcomes.
  Reported by Dabaron @ BeBot Forum.
- Better error logging for php enabled. Writes errors to ./log/php_errors.txt
- Added more events to AlienAttack_GUILD module from Xenixa.
- Fixed a bug in AlienAttack_GUILD module where it would never set $this -> type = "repeat";
  Also decreased the interval at which the bot complain about the cloaking device still being disabled.
- Multiple modules updated to make use of the new whois cache.
- Blacklist module will now allow you to remove characters from blacklist that has been deleted or renamed.
- LogonNotify_GUILD.php is now enabled by default.
- Only display commands that the user has access to in help.
  Idea by MatHack @ BeBot Forum.
- Added Angels AOChat hack to fix the "not expecting login" issues without the need for aokex.
- Backport latest AOChat library (excluding the new queue) making it php 4 compatible.
- Bot will now correctly connect to Rimor (RK3) without the need to alter the source.
- We now take steps to ensure that we do not keep the username and password in memory after we have connected.
- Fix multiple crashes in points module.
- All file headers have been updated.
- Added Credits file containing aknowledgements.
- Updated About module.
- The server load module will now work correctly on Testserver (RK0) and Die Neue Welt (RK3)
- Fixed a bug in the TowerAttack module leading to a MySQL error if the bot fails to lookup a player.
- Fixed a bug where a guild member would remain on the Online list if they where online when they where removed from the guild (/org leave).
- Added a workaround for BotHelp overflowing the max blob character count on bots with large number of commands enabled.
- Fix a bug in the Bid module causing bot to crash if someone with no raid_points entry tries to bid.
- Increase default max_blobsize to 12000.
- Added new core command send_permission_denied($to, $command, $type) to send command permission denied errors to users.
- Synched Level information with Helpbot. Graciously provided by Vhab :)
- Added the bot functions int_to_string and string_to_int to convert between int and string and converting overflowed integers to unsigned integer string values
  and vice versa.
- Fix an issue with !calc throwing errors if $result == 0.
- Org Roster update also updates whois cache data.
- Whois lookups automaticaly fall back to Auno if anarchy-online.com lookup fails.
- Team administration module works again and now also removes players that leave correctly.
- Updated History module.

Updated Modules:
- Updated Time module, see: http://bebot.link/wiki/doku.php?id=time_module 
- Updated Items module

New Modules:
- Added settings managment and interface: http://bebot.link/wiki/doku.php?id=settings


-------------
Version 0.3.3
-------------
- Fixed a MySQL error in Admins.php.
- Fixed directory traversal security issue in the HELP module.
  Thanx to Somebotty @ irc.funcom.com for discovery and notification.
- PHP split into a separate branch to conserve bandwith and make download sizes more manageable.
- The log function have been changed so that if the second parameter is "Security" the event is logged
  to security.txt in the log directory and an alert is sendt to guildchat or private group.

New modules:
- Replaced old Items.php with new module by Vhab.


-------------
Version 0.3.2
-------------
- Really, really fix the "bot doesnt listen to org chat" bug.
- "Admin" should no longer erronously send error message when no parameter is given and admin list is displayed.
- Added Akarah's "Online" fancy format. Can be toggeled using the command: admin mode fancy/basic
- IRC relay updated to display new AO Mainframe URL for item links.
- Fixed a bug making !victory record the wrong loosing side.
- Renamed _ClassName.php to _ExampleModule.php and updated some examples.
- Bot should now work "out of the box" on windows provided you have MySQL setup.
- Eliminate another potential BeBot <-> BeBot spam loop.
- Removed Raids module as it is now merged into the News module.
- Fix issue with IRC module causing bot to refuse to startup if no server has been set.
- Fix the LogonNotify_GUILD module to actually send proper prefixed commands.
- Revamped how MySQL errors are handeled. Most notably the bot will now make a decent
  attempt at reconnecting to the database every 30 seconds or so when the database connection is lost.
  (The reconnect is only an issue for non local database servers)
  Output limiting has also been put in place to prevent more than 10 errors in 30 seconds from
  being displayed to prevent console/log floods.
- Raid_single renamed to Raid.
- New raid commands:
   raid add <name> - Adds a player to raid, regardless of lock status.
   raid command <message> - Creates easy to read text in pgroup
   c <message> - Alias for raid command.

New modules:
- Replaced GuildRelay module with Xenixa's modified GuildRelay module.
  Also incorporates Craized's Notify module.
- Replaced the News module with the updated news module by Xenixa

Database changes:
- "Admin" module now adds the description coloumn if missing.

-------------
Version 0.3.1
-------------

- Fixed a bug in Tier2 module. NT's should now qualify for the correct Wills.
- Raidleader is now a hardcoded access level with id 3.
  NB: If you had custom access levels added, you may need to correct the list as
  raidleader will be forcibly entered as entry with id 3, replacing any old entry with the same ID.
- admin module works properly again. Reported by Akarah
- Various typos and spelling errors fixed.
- "TowerAttack" module updated to handle new tower attack messages. - Xenixa
- Ensured that the TowerAttack module wont break when Funcom gets around to tokenize the rest of the tower attack messages.
  AOChat will still be required to carry out the actual convertion before it will work when it happens however.
- Added cronjobs for: 1, 5, 10 and 30 seconds and 3, 6 and 18 hours. - Xenixa
- Added alias "Cloak" for "City" in the AlienAttack_GUILD module and updated how the information is displayed. - Akarah
- Fixed a bug in cut_size in Bot.php - Wolfbiter
- Bot no longer enables guild relay on startup if guild relay is disabled.


-------------
Version 0.3.0
-------------

- New version number convention. Major.Minor.Patchlevel, where even
  Minor numbers denote stable releases and odd numbers denote development releases.
- Added setting in Bot.conf to allow guild relay to activate upon login.
- Bot now ignores tells with messages indicating they are from another BeBot asking
  to send "/tell <botname> <prefix>help".
  This makes it less likely to end up in a tell loop with another bot.
- The command admin with no arguments now provides a list of all admins.
- The "online" command now shows Ailien levels, AFK status and SuperAdmin/Admin/Raidleader status.
- Logon/off notices are now relayed over the guild relay (This is still partly broken though)
- Levels module updated with new pvp ranges.
- The "news" command now displays the time and date of the last updated news item without having
  to open the chat blob.
- The Points module has been updated to allow the two following commands:
  points <name> - Display the points of a single member
  points top25 - Display the top25 points
- Fixed a bug allowing someone to crash the bot using "invite"


New modules:
- Added Khalem's LogonNotify module which sends Online, News and Raids to guildmembers logging in.
- Added Foxferal' History module.
- Added Foxferal's Blackist module.
- Added Foxferal's Raids module.
- Added Craized's AFK module.
- Added Alreadythere's custom rights management module.
  You can now control who can access what commands using the "commands" command.
  Please note however that some modules might impose their own access restrictions
  in addition.
- Added Blondengy's IRC module.
- Added Derroylo's Pocketboss and Symbiants module.
- Added Zacix's Teams module.
- Added Sabar's Tier2 raid module.

Database changes:
- admin_groups have a new field named: description VARCHAR(80)
- news have a new field named: time INT NOT NULL
  Value of id needs to be moved to time, and a new id assigned.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on September 08, 2005, 01:15:33 pm
I've done some modifications for the bebot based raidbots I host, perhaps you want to include some of it into your release (after a quick read through of the diff file I don't think my modifications will clash that much with yours).

Things I did are:

1) Add a master table that holds all table names. The name of the master table is {$botname}_tablenames, but is configurable in Bot.conf. All other table names are hold in the table only, including information if they use a prefix or suffix (both default to $botname). Added get_tablename() function to the Bot class. Did all this because I'm running more then one bebot, and didn't fancy making a database for each bot. Besides, it allows me to share some tables over bots if wished or needed. Like two raidbots for one org, which use the same adminlist, banlist, access rights.
Modified the files I need to use the tablenames out of the database.

2) Moved colors out of config file into the settings table - I mean, we got it, why not use it? Besides, needing to restart the bot just because I want to change a color got tiresome. To simplify the access to settings I added get_/set_setting() wrapper to Bot class.

3) Wrote an access rights management for all commands. As it is anchored in the inc_(tell|pgsmg|gmsg) functions, it will handle all commands, even those I don't have/know about. Access rights are saved in a table, and based on groups (Admingroups/Member/Guests). Just if you want different access rights for subcommands, you will need to do that in files, this module doesn't handle them.

4) Heavily modified the PrivGroup.php (based on this modification (http://bebot.fieses.net/viewtopic.php?t=80)). Access can now be restricted based on faction and/or level, you can add orgs that should be treated as members (without adding them to the members table), you can even set the bot free for all (so all are treated as members). All without restarting the bot. Added a banlist. Added !kickall (needed a slight modification to AOChat, as in the kickall a parameter was missing).

Only thing missing in most of my modifications is fancy in-game GUIs, I do the changes directly in the db using phpMyAdmin.

If anyone has interest in my addons I'll go around and make them available as diff against the 0211 code, and as zip with the whole files.
All works with php 4.3.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on September 08, 2005, 05:21:21 pm
Even though nobody posted here the files:

diff file (http://www.m8y.de/ao/bebot/bebot0211AT.diff.gz)
all modified files as tgz (http://www.m8y.de/ao/bebot/bebot0211AT.tgz)

Two slight warning though:
1) I just uploaded the core files, if you use my default settings for table names you won't be able to use most modules without modifying. To do that, set prefix to false for all tables in the mastertable (or directly edit main.php before starting)
2) As I only use the bots as raidbots I commented out a few guildchannel commands, and didn't write a default access setting for guildchannel. As the setting command_default defaults to false you won't be able to use a single command in guild chat before adding those rights.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on September 13, 2005, 08:01:07 am
Thanx, i'll have a look at things when i get the time :)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Zarkingu on October 21, 2005, 03:19:47 pm
Quote from: "Alreadythere"
Even though nobody posted here the files:

diff file (http://www.m8y.de/ao/bebot/bebot0211AT.diff.gz)
all modified files as tgz (http://www.m8y.de/ao/bebot/bebot0211AT.tgz)

Two slight warning though:
1) I just uploaded the core files, if you use my default settings for table names you won't be able to use most modules without modifying. To do that, set prefix to false for all tables in the mastertable (or directly edit main.php before starting)
2) As I only use the bots as raidbots I commented out a few guildchannel commands, and didn't write a default access setting for guildchannel. As the setting command_default defaults to false you won't be able to use a single command in guild chat before adding those rights.


Trying to set my bot up with these modifications, but not sure I understand what to edit in main.php to get it to work. Care to explain abit more what to modify to get it to work properly?
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on October 21, 2005, 04:36:51 pm
In my main.php I got the following:
Code: [Select]
/*
Prepare the MySQL database
*/
$db -> query("CREATE TABLE IF NOT EXISTS " . $master_table . "(internal_name VARCHAR(255) NOT NULL PRIMARY KEY, table_name VARCHAR(100) NOT NULL," . " use_prefix VARCHAR(10) NOT NULL DEFAULT 'false', use_suffix VARCHAR(10) NOT NULL DEFAULT 'false')");

// add the default settings, if not existing
$db -> query("INSERT IGNORE INTO " . $master_table . " (internal_name, table_name, use_prefix, use_suffix) VALUES ('prefix', '" . strtolower($bot_name) . "', 'false', 'false')");
$db -> query("INSERT IGNORE INTO " . $master_table . " (internal_name, table_name, use_prefix, use_suffix) VALUES ('suffix', '" . strtolower($bot_name) . "', 'false', 'false')");
$db -> query("INSERT IGNORE INTO " . $master_table . " (internal_name, table_name, use_prefix, use_suffix) VALUES ('settings', 'settings', 'true', 'false')");


followed by more lines like the last.
Those INSERTs create all the default names for tables. It's Internalname (used for my get_tablename() command), tablename in the database, and then whether prefix or suffix is used.
The prefix/suffix lines just define what is used as default prefix and suffix (botname).

So if you want some custom table names, you need to edit this file before first start, or edit the entries in the mastertable with something like phpmyadmin.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Zarkingu on October 21, 2005, 05:29:03 pm
Ah I see.
Started the bot with defualt names and it worked fine :)

Stumbled on another problem though, kinda related to the same.

Added your topic module, but get an error message when trying to launch bot with that activated.

(Table 'testbot.settings' doesn't exist)

Fatal error: Call to a member function on a non-object in D:\Servers\Bots\Testbot\modules\topic.php on line 46

I checked if the table settings actually existed and it does. Any ideas what could be wrong here?
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: kinbaku on October 21, 2005, 07:24:00 pm
Quote from: "rogerDAT"

Added your topic module, but get an error message when trying to launch bot with that activated.


Fatal error: Call to a member function on a non-object in D:\Servers\Bots\Testbot\modules\topic.php on line 46



I get this same problem when i try to use it. I am also unable to find the problem myself.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on October 22, 2005, 01:22:17 am
Found the error in line 46, corrected version in the other thread.

Moved the get_setting function, and forgot to adapt the call for database access.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on October 22, 2005, 01:24:49 am
Quote from: "rogerDAT"
Added your topic module, but get an error message when trying to launch bot with that activated.

(Table 'testbot.settings' doesn't exist)

Fatal error: Call to a member function on a non-object in D:\Servers\Bots\Testbot\modules\topic.php on line 46

I checked if the table settings actually existed and it does. Any ideas what could be wrong here?

For the error check post above or topic thread.

The warning about the settings table could happen if you use my posted topic module, and my modified bot with get_tablename function. They can only work together if you set prefix for settings to false (is true in my standard version). I back-coded the module for the general bot :)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Zarkingu on October 22, 2005, 03:03:37 am
I changed the prefix for settings to false and updated the topic module, but still get the same error as before. :(
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on October 22, 2005, 09:41:26 am
Blame my late-night editing - actually removed one error, but missed the (exectly duplicat) error in line 46. Should work now.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on October 22, 2005, 05:53:27 pm
Small update.

Getting closer to 3.0 now

I still need to add some community provided changes, and finish my database changes.
Some of these changes will require you to start out with a fresh table in some cases for certain modules, and i'd like to keep breakage to a minumum by doing it in one version instead of having to go trough it little by little.
Title: One suggestion
Post by: Sabkor on November 16, 2005, 06:24:47 pm
Could I get you to add the following to the settings table, please?

Field:
ShortDesc - A VARCHAR that contains a short user-friendly name of setting (example: Points to Main:)
LongDesc - A VARCHAR that contains a long description of the setting (example: With this setting on, all raid-points are transfered to the players main character, providing they have setup their alts. With it off, each character has it's own points pool.)
Type - A VARCHAR that contains the type of variable (example: ONOFF) Other Types would include NUMERIC and STRING.
DefaultOptions - A VARCHAR that contains the defaults (semi-colon separated) to be displayed to the admin when providing click links for them. This would only be used for NUMERIC or STRING types.
Group - A VARCHAR that contains the name of a settings grouping (example: Raid Setup)

What I would be using this for would be a dynamic settings panel allowing the admin to click settings. The type would allow me to present clickable options easily to the user. If all people writing modules filled out these fields, it would be much easier for the user. It would be much easier if these were in the "base" BeBot for me, as then module programmers would more likely fill them out ;)

Because of this, I would also like to see all settings create themselves on startup, even if they stay at the default value, not just if the defaults are changed.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Sabkor on November 16, 2005, 06:25:28 pm
Oh, and another thing, if you'd rather me do the work and mail you the code, let me know that too ;)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 17, 2005, 01:03:09 pm
Sounds good Sabkor.

If you want to create a diff containing the changes, feel free to do so and i will merge it with my working copy.

Else i will add it to my ToDo list, but i should warn you its rather depressinly long atm. In between trying to find a job and playing AO, i have 4 other projects that take up some of my time.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on November 17, 2005, 01:24:07 pm
Quote from: "Khalem"
Else i will add it to my ToDo list, but i should warn you its rather depressinly long atm. In between trying to find a job and playing AO, i have 4 other projects that take up some of my time.

Feel free to PM me the todo list, perhaps I have some of the things done already, or I feel like doing them :)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: jjones666 on November 18, 2005, 12:40:22 am
Looking forward to relay being automatically turned on when bot loads =)

-jj-
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 18, 2005, 09:39:16 pm
See first post for details. Released development version 0.3.0 (See changelog for changes to the version numbering convention)

Alreadythere:
I'll see what i can come up with. Im afraid i havent even been able to look into the code you posted in your first post in this thread yet :(
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on November 19, 2005, 12:41:09 am
Quote from: "Khalem"
Alreadythere:
I'll see what i can come up with. Im afraid i havent even been able to look into the code you posted in your first post in this thread yet :(

The biggest functional change I made is the custom rights management, which you already included.
The only other real change I did (colors and PrivGroup are more or less just cosmetic) is the flexible table names.
Basic problem I had: all table names in bebot are fixed atm, so if I want to run more then one bot at once, I need more then one database - because you can't share all tables really.
I removed all fixed tablenames, and replaced the names with a call to a get_tablename() function, which gets the old table name as parameter. I put that function into Bot.php, a new module under core would perhaps be more helpful.
get_tablename looks up the parameter in a master-table (the name of this master-table is fixed in the Bot.conf, default is botname_tablenames), and reads out of the table the real name, and if a prefix/suffix should be used (both default to botname, and for most tables prefix is true, suffix is false). Out of this information it creates the tablename to use, and returns it.
Basically an easy change, it just forces you to modify ALL database calls in ALL modules.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Zarkingu on November 22, 2005, 06:49:01 pm
I just set up the bot to test it in my guild.
One little problem. The bot updated the roster just fine, but it started spamming XXXX logged off for those that was not online at the time I started the bot. All this spam was displayed in org chat.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 22, 2005, 08:12:12 pm
I know about this issue, and its actually not a new one, it has always been there.

For large orgs in particular there will be massive spam during the adding of members to the buddylist. The good news is that it should only happen the very first time you start the bot (or if the bot happens to crash after having wiped the members list in preparation for readding updated information)

It should be possible to work around this, but atm its a low priority.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Zarkingu on November 22, 2005, 08:17:36 pm
It only happend when the bot was updating guild members at first startup. Works like a charm now. :)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 27, 2005, 06:51:06 pm
Sorry for the delay, but here it is.
The most notable things on my Todo list atm is:
- Guild rooster handeling. This needs to be changed in a way that it does not wipe the members table every 12 hours when updates run.
Possibly using a disk based xml cache with md5 sums to detect changes to prevent uneccecary database load, especially in larger orgs.
There also needs to be table modifications to allow guild name to be stored. Possibly also an integer field to designate if an entry designates a member of the host org or not as this is probably a cheaper way to do the check than to compare guild names.

- Related to guild rooster handeling. As the bot can now access org join/leave/kick messages, the guild rooster can be keept more up to date without having to rely soly on XML updates or the creation of an IGN like guild assistant which checks if the person is a member for every line uttered in GC.

- Also guild rooster related, while it should only happen on an empty buddylist/member table, there needs to be a flag set to prevent mass flooding of guild chat of logoff messages. There should also probably be a generic logoff flood detection for Chatserver screwups. Say recieving x logoffs within x seconds and we stop sending logoff notifications for x seconds.

- Addition of 1, 5, 10 and 30 secondcronjobs. Addition of 3, 6 and 18 hour cronjobs.

- Easier way to manage and access settings. Preferably add a function to read settings from database, store in memory for quicker/cheaper access and add a reload function to force reloading of settings.

- Make color settings more accessible and update all standard modules to use configured colors.

- Raids module needs to be improved with the ability to add people to raid without unlocking, ability to kick all people in pgroup that is not in reaid from pgroup.

- Bid module needs to be updated to discourage bids aimed soly at increasing the bid amount, Pande style. Also needs a way of allowing only people actually in raid to bid, either trough a toggle setting or via two separate bid start commands, or a mix of those meaning the default bid command behaves according to setting.

- Raffle command needs the same type of toggle as bid

- Configurable table prefix to allow multiple bots to share the same database

Im sure i left some out, but i couldnt find my actual Todo list for Bebot offhand.

If anyone wants to undertake any of the above, feel free to do so, just be sure to leave a note stating that you are to prevent someone else or myself from doing double work.

On a small side note, i now have the BeBot subversion repository back up and running and i will be opening it to public read access soon.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Xenixa on November 28, 2005, 02:27:53 am
Quote from: "Khalem"

- Addition of 1, 5, 10 and 30 secondcronjobs. Addition of 3, 6 and 18 hour cronjobs.

Done. All except the 1 sec cron job.
Also includes the code changes for the AO Extended Chat messages:
ftp://xen.afraid.org/bebot_files/Bot031.php
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Wanuarmi on November 28, 2005, 03:06:45 am
wont 1s cron jobs lag if there are alot of jobs? I mean, wont some be missed or theres a queue?
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Xenixa on November 28, 2005, 03:40:05 am
Exactly why I didn't add 1 Sec Cron jobs ;)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on November 28, 2005, 04:36:06 pm
Made a basic core module that allows more flexible tablenames:
Code: [Select]
<?
  /*
   * TableNames.php - database based table names.
   *
   * Written by Alreadythere
   * Copyright (C) 2005 Christian Plog
   */

/*
Create the table for access rights
*/
  $db -> query("CREATE TABLE IF NOT EXISTS " . $bot -> master_tablename . "(internal_name VARCHAR(255) NOT NULL PRIMARY KEY,"
                . " table_name VARCHAR(100) NOT NULL, use_prefix VARCHAR(10) NOT NULL DEFAULT 'false',"
                . " use_suffix VARCHAR(10) NOT NULL DEFAULT 'false')");

  // add the default settings, if not existing
  $db -> query("INSERT IGNORE INTO " . $bot -> master_tablename . " (internal_name, table_name, use_prefix, use_suffix) VALUES ('prefix', '"
. strtolower($bot_name) . "', 'false', 'false')");
  $db -> query("INSERT IGNORE INTO " . $bot -> master_tablename . " (internal_name, table_name, use_prefix, use_suffix) VALUES ('suffix', '"
. strtolower($bot_name) . "', 'false', 'false')");

$tables = new TableNames($bot);

$bot -> tables = &$tables;

/*
  The Class itself...
*/
class RightsManagement
{
        var $bot;

        /*
        Constructor:
        Hands over a referance to the "Bot" class.
        */
        function RightsManagement (&$bot)
        {
                $this -> bot = &$bot;
                $this -> master_tablename = $this -> bot -> master_tablename;
        }

        function get_name($table)
        {
                $name = $this -> db -> select("SELECT * FROM " . $this -> master_tablename . " WHERE internal_name = '" . $table . "'");

                $tablename = $name[0][1];

                if ($name[0][2] == 'true')
                {
                        $prefix = $this -> db -> select("SELECT * FROM " . $this -> master_tablename . " WHERE internal_name = 'prefix'");
                        $tablename = $prefix[0][1] . "_" . $tablename;
                }

                if ($name[0][3] == 'true')
                {
                        $suffix = $this -> db -> select("SELECT * FROM " . $this -> master_tablename . " WHERE internal_name = 'suffix'");
                        $tablename = $tablename . "_" . $suffix[0][1];
                }

                return $tablename;
        }
}
?>


It requires some changes in Bot.php (new variables tables and master_tablename), main.php (master_tablename needs to be a new parameter for the Bot class) and the Bot.conf (new field master_tablename, default I use is botname_tablenames).

Basic idea now is: there is an entry for every table used by the bot (best added in the module adding the table).
The function get_name builds the table names, using the entry for the table in the parameter, and adding prefix/suffix if wished.
And instead of doing queries in the form "SELECT * FROM members WHERE whatever" use queries in the format "SELECT * FROM " . $this -> bot -> tables -> get_name("members") . " WHERE whatever".

My class is just the basic, to fully modify the bot every single query to the DB needs to be adapted. That's the real work sadly.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on November 28, 2005, 04:42:55 pm
Got some ideas about the roster, with the new join/leave messeges.

How about using the current roster update only once on bot start anymore (you never know how long a bot was offline, and what all changed in the off-time). All further changes to the roster can now be done using the leave/join notifications, and any needed info can be queried here too.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 28, 2005, 06:49:47 pm
Added the cronjobs. Thanx.

I also added the 1 second cronjob. Yes, if theres loads of them it will probably slow the bot down. Hence why it should be used with care, but id still like to have it there for now.

As for the rooster update idea Alreadythere, that would work if the servers also told us whenever changes happened to the rooster like level, alien title and even name.

There also is the issue of deleted/rerolled characters removal from rooster.

The way things are now we need to update this once a day at least :\
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on November 28, 2005, 07:00:37 pm
Quote from: "Khalem"
As for the rooster update idea Alreadythere, that would work if the servers also told us whenever changes happened to the rooster like level, alien title and even name.

There also is the issue of deleted/rerolled characters removal from rooster.

The way things are now we need to update this once a day at least :\

True, forgot about that.

But then I'm seriously contemplating to write a global whois-instance for my bots, which saves all whois' ever done in a table (new entry if not yet in there), and a cron job running outside the bot that updates that table once a day. Basically a mirror of FCs database - would be huge (100mb+ I guess), but not impossible huge with todays storage sizes.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on November 28, 2005, 07:15:22 pm
I think a file based whois cache would be better suited, with a configurable cache path to allow it to be shared between multiple bots.

This way you would have a local copy of only the files you need, the first time its requested it gets downloaded. Subsequent reqeusts check the time. If the file is older than $max_cache_time

Preferably youd also store the md5 sum of the file to be able to detect changes aswell to allow the cache to be used for the org rooster updates.

Just making a "mirror" of all the data isnt much good, youd use more resources than you save. It only makes sense if your making a character database like Auno.org, but not otherwise.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Evereane on December 01, 2005, 04:35:45 am
Just informing, 0.3.0 doesn't work. Let me explain a little.

It starts up fine, it grabs all the people in the guild, updates itself. Now, after it does all this, I try to send a command to it....
ex: !online
replied with
"/tell <bot> !help"

I /tell <bot> !help and it replies back with....

"/tell <bot> !help"

This is a clean install... why would it be doing this? 0.2.1.1 works fine... well.. as fine as a beta will work  :lol:

Thanks :)
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: skeezix on December 01, 2005, 06:00:57 am
mine was doing this as well, and spamming with "xxxx logged off" after a while for every user (mentioned elsewhere and I'll look into that) and I think this was running php 5.1.1 if I remember right.
I had other issues with php 4.xx and will search more on those ;p

This was also with a clean install
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: jjones666 on December 01, 2005, 08:23:25 am
I had the same problem Evereane - you need to set the access on the bot with the custom rights module with the !commands tell.

-jj-
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Khalem on December 01, 2005, 01:20:31 pm
Ahh yes.

That would be because i forgot to include the updated Rights management.
Issuing: !commands   should allow you to set permissions in the meantime.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Nogoal on December 06, 2005, 01:00:46 pm
!admin doesn't seem to work. It only display the admin list blob. You can't create groups or add admins.

And i didn't figured how to make the bot public. !commands needs the bot to be restarted? Some commands from Unoffical modules don't work. I didn't tested it any further as my old version work without problems.
Title: Bebot 0.3.x Development [release 0.3.0]
Post by: Alreadythere on December 06, 2005, 03:42:09 pm
Quote from: "Nogoal"
And i didn't figured how to make the bot public.

You will need to edit the is_member function to handle membership by faction/level/some other requirement.

Quote from: "Nogoal"
!commands needs the bot to be restarted? Some commands from Unoffical modules don't work. I didn't tested it any further as my old version work without problems.

No, !commands works as soon as set, as the checks are done during runtime.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 12, 2005, 03:00:19 am
Version bump.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on December 13, 2005, 01:45:58 am
Hi Khalem,

Could the updated news.php also please be included in release, this is a very useful feature to be able to delete news.

http://bebot.link/index.php/topic,218.0.html

And btw, cheers for including my updated PB's in the main release.

Thanks,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 13, 2005, 01:47:55 am
News updates will be coming. I just havent gotten around to it yet :)
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jokerjr on December 13, 2005, 02:36:05 am
How do we get the latest dev release?  Looked thru the thread but didnt see any download links.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on December 13, 2005, 02:58:02 am
Hi Khalem,

Just noted that the guestlist function does not seem to work in the SVN version.

I was previously using Xenixa's Relay_Guild module (http://bebot.link/index.php/topic,199.0.html) and
updated to the latest Relay_Guild in SVN (alongside all of the other files).

Upon doing !guestlist it displayed the guests but with some debug messages (I assume - char ID's etc).  I removed
the guests and re-added, now nothing displays in !guestlist.  Tried dropping the table and re-adding guests, but
still no joy.

I would also assume that notify.php would be incorporated into the SVN version?

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 13, 2005, 03:07:40 am
How do we get the latest dev release?  Looked thru the thread but didnt see any download links.

In the first post you will find a file attached :)

Hi Khalem,

Just noted that the guestlist function does not seem to work in the SVN version.

I was previously using Xenixa's Relay_Guild module (http://bebot.link/index.php/topic,199.0.html) and
updated to the latest Relay_Guild in SVN (alongside all of the other files).

Upon doing !guestlist it displayed the guests but with some debug messages (I assume - char ID's etc).  I removed
the guests and re-added, now nothing displays in !guestlist.  Tried dropping the table and re-adding guests, but
still no joy.

I would also assume that notify.php would be incorporated into the SVN version?

Good catch.
The version in SVN is actually one of the first working versions Xenixa made. I hadnt gotten around to updating it yet.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on December 13, 2005, 03:14:36 am
Glad to be of help :-)

Re-added Xenixa's module from the link above, added missing columns back in SQL, deleted guests and re-added
them and now works perfectly again.

On a positive note, after updating from 2.1.1 to SVN build 42 bot is functioning 100% - only non standard files are
glara apf module, modified news and modified relay_guild here.

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 13, 2005, 03:28:21 am
Updated first post with SVN information for those that are feeling really brave.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Wanuarmi on December 15, 2005, 06:31:22 am
do we have access to the svn? Rooster_RAID.php has the same big chunk of code twice changing only the response, to privgroup or tells...
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Wanuarmi on December 18, 2005, 08:20:35 pm
can we use the svn system? if I get one of the scripts there and improve the code what should I do (post here, create a new topic)

and is there a reason bebot uses <? instead of <?php
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Akarah on December 18, 2005, 09:51:04 pm

and is there a reason bebot uses <? instead of <?php

3 less bytes? ;)
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 18, 2005, 10:37:40 pm
For now, id prefer keeping control over what goes into SVN, so id like patches to be submitted on the forum, either as a full post of the module containing changes, a post detailing the changed code, or simply a diff (-burN) if that's your preferred method.

Giving out SVN access is something id like to do at some point however, granted some guidelines will need to be drawn up and agreed upon.
The community has provided more code overall to BeBot than i have, and i suspect that will never change :)

As for <? vs <?php, that would be a question to ask Blondengy. I'm not aware of any reasons why <?php shouldn't work, and i expect its done that way as a matter of personal preference on Blondengy's part.

Here on the forums at least however using <?php has clear advantages when it comes to posting code. Although I'm hoping to find the time to make the "php" bbcode create a nice box like "code".
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Wanuarmi on December 19, 2005, 05:45:30 am
As for <? vs <?php, that would be a question to ask Blondengy. I'm not aware of any reasons why <?php shouldn't work, and i expect its done that way as a matter of personal preference on Blondengy's part.

I think <?php is what most interpreters use, I read somewhere someone had to change all <? to <?php because the other way messed with xml handling on his server... and I read that as well on some documentations on php, that coders always should use that for that reason etc

about the svn, id expect you to review all the code before adding them to the folder, seems svn doesnt work like that though. can we post code improvements on the forums?
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on December 19, 2005, 11:43:47 am
Post away.

Anything that doesn't break stuff badly or i think is a bad idea will usually be more or less automatically added to SVN when i have time.

And yes, some php configurations may have strict php tags enabled which means <?php is required.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Xenixa on December 19, 2005, 01:04:48 pm
Hmm, well if you're just feeding the php.exe CLI .php documents is pretty safe for the CLI to assume it's a php doc when it see's <? ... ?>
Pushing the .php through a Web server I would expect it to be looking for the doc type after <?
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on January 02, 2006, 12:41:42 am
Hi Khalem,

(Duplicate column name 'description')

Upon running bot (in admin.php), don't think the code to check if that column exists works quite right.  Only cosmetic :-)

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on January 07, 2006, 12:36:23 am
You have the bot relaying to another bot?

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on January 07, 2006, 12:39:09 am
Having this spamming:

[TELL] [IN] I only listen to members of this bot.
[TELL] [OUT] I only listen to members of this bot.

Over and over.

Any suggestions/fixes?
(I've got the 0.3.1 release)

Just comitted a fix for this to SVN.

In Bot.php on line 347:

if (!preg_match("/is AFK .Away from keyboard./i", $args[1]) && !preg_match("/.tell (.+)help/i",$args[1]) && !preg_match("/I only listen to members of this bot/i",$args[1] ))
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Naturalistic on January 07, 2006, 01:16:03 am
No, ignore that.

It was because I misread something :p

in Bot.conf, I put my bot's name under Guide_relay_chat thing, when it's suppose to be empty if you're not linked to other bots :P

Seems to be working now.

Sleep ftw!
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on February 01, 2006, 09:00:41 pm
Hi Khalem,

Something seems borked in the new SVN (#70) news and logonnotify module, on logon I get this:-

[Jjbot]: Welcome to Insert Name, Jackjonez
[Jjbot]: 0 Members and 2 Guests Online. :: click to view
[Jjbot]: /tell jjbot !help

This applies to both guests and members.

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on February 01, 2006, 10:19:11 pm
Small typo.

SVN now at rev 72 where it should be fixed.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on February 02, 2006, 01:00:54 am
Hi Khalem,

Thanks, that works.

Just as a note, this warning still pops up (from admin.php)

MySQL error (# 0) on query: ALTER TABLE admin_groups ADD description VARCHAR(80)
Duplicate column name 'description'

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on February 02, 2006, 01:03:45 am
Im aware.

I still need to look into a way to bypass the warning, or better yet, come up with a better system for updating the database tables.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Ainen on February 23, 2006, 12:33:58 am
Where did the Logon_Notify module disappear to in the latest svn (74) release?
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: MatHack on February 23, 2006, 03:41:08 am
It was renamed to "_LogonNotify_GUILD.php"
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Ainen on February 23, 2006, 09:54:12 pm
The one off by default in v74 is the same one from the standard version, that causes the "/tell bot help" messages on login. I managed to pull the v72 version out of svn and tried it out (sleep helps tired 'trox eyes  ;D) and it uses a slightly different mechanism to tell the messages, and that worked fine.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on February 24, 2006, 05:13:01 am
Fixed in Rev 75
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: sentry on March 02, 2006, 01:04:23 pm
Getting the following error running bot as a raidbot

Code: [Select]
MySQL error (# 0) on query: SELECT id FROM guests WHERE id = 870820816
Table 'botname.guests' doesn't exist

Is this because its setup as a raidbot and there is no guestchannel?

all i did for now was copy the members table to guests and clear contents.. no error
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on March 04, 2006, 11:50:42 am
Hi Khalem,

Nice additions to raid module in svn 80 btw.

I noticed !raid add is not case-sensitive but !raid kick appears to be.  ie. kick curesall doesn't work, kick Curesall does.

Any chance of a raid !pause/unpause in the future?

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: jjones666 on March 04, 2006, 06:30:21 pm
Using !admin add does not work with SVN 80, !admin del working fine.

Can anyone else confirm?

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on March 04, 2006, 08:01:27 pm
admin add should work, i'll need to reverify though.

The plan for Raids module is to eventually merge the two current raids module into one, and at that time, raid pause will definately be a command.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: MatHack on March 05, 2006, 04:06:04 am
Using !admin add does not work with SVN 80, !admin del working fine.

Can anyone else confirm?

Cheers,

-jj-

This shouldn't work in a /tell, but should work in gc/pgmsg, it's because Khalem made a mistake :)

core/Admin.php (Rev 80), line 94 has a ([a-zA-Z0-9]+) too much; line 136 has a ([a-zA-Z0-9]+) too less.
Title: Re: Bebot 0.3.x Development [release 0.3.1]
Post by: Khalem on March 05, 2006, 11:54:51 am
Good catch. Fixed.
I hadnt noticed since i usually do it in pgroup.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 06, 2006, 09:28:11 pm
0.3.2 bump
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 06, 2006, 11:03:52 pm
Nice work as always.

2 more weeks of serious work for me, after that I'll try to go around to some internal clean up, namely customizable table names (planing to use a slightly reworked version of the one I posted), decent setting interface (will try to incooperate more fields like suggested somewhere in this forums), reworked gui for my custom rights module, slightly updated whois module (perhaps I'll get around to cut down the members table too while being at it), and a reworked color scheme (2 tables, one with colors, one with color keys for specific things). Will post more before starting :)
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 07, 2006, 10:37:07 am
:)

I still havent gotten around to the table names yet, but it's going to be added. Next big thing for me now is to add the whois cache and whois handeling into the core, and then the member table and roster cleanup.
Most of the dirty work for that is already done by you and Xen and others, its just pulling it all together and working out any niggles :)
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: MatHack on March 08, 2006, 06:46:11 pm
Found an error in a mysql-query:

Admin.php, line 233-234 should be:

Code: [Select]
$res = $this -> bot -> db -> select("SELECT name FROM admin_members WHERE name = '" . ucfirst(strtolower($member)) .
"' AND admin_group = " . $result[0][0]);
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: jjones666 on March 09, 2006, 12:28:25 am
Added !raid pause/unpause to the SVN 86 version, using code from elsewhere on the site.  Works fine.

The case-sensitive !raid kick is still a little bit of a pain ;-)

http://www.jjones.co.uk/files/raid.php with raid pause etc included.

BTW, one other little item a !bid stop command would be useful to abort auctions if at all possible.

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 09, 2006, 05:37:14 pm
Admin.php error fixed. I was aware of it but have been slacking since it was rather non fatal.

bid stop/cancle is on the todo list. Annoys me to no end aswell :P
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: skeezix on March 15, 2006, 02:33:28 pm
Not sure if this will belong here, but we'll see! :)

I went through this (http://bebot.link/index.php/topic,274.0.html) post about using aokex.dll on a windows system, and used that to get the bot running under php5.  (using 0.3.0 I think atm if this is the issue yell at me please)
I got errors from the SmartIRC.php saying this
Code: [Select]
Warning: array_key_exists(): The second argument should be either an
array or an object in /usr/local/lib/php/Net/SmartIRC.php on line 1948

I upgraded the SmartIRC.php from PEAR (http://pear.php.net/package/Net_SmartIRC) and it seems to fix the problem, let the bot started and it logged into IRC.
But that was about it :)  I got no other messages on the console and it seemed to lock up.
I tried a couple times briefly and it seemed to respond for a short while until it started the roster update or something, or maybe just a bug from the new IRC module.  I haven't done much yet in tracking as I just needed to get the bot back up at this point.

So... I moved back to php 4 and had the same issue (without using the aokex.dll).  Until I replaced the SmartIRC.php back with the original 0.5.5 I think, then everything started working.

ideas? lol... 
<---- noob
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 15, 2006, 05:48:54 pm
First id say try out 0.3.2 :)

Second, double check your IRC settings. I'll look into it though. Im not sure if we are on the latest SmartIRC as the version information has been overwritten.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 21, 2006, 06:08:54 pm
SVN down?
Just tried to get a current version of your sources, and couldn't connect to the server.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 22, 2006, 07:00:40 am
SVN is up. It will be down for a bit though due to some unexpected problems starting later today or tomorrow.
The system SVN is hosted on is being moved to a new hosting location
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 22, 2006, 03:19:03 pm
Strange, tried to access the server, but never managed to connect. Simply doesn't work for me, even though I can reach the server.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 22, 2006, 06:10:07 pm
Could something be blocking traffic on port 7100?

Anyways, im planning to possibly move the SVN repository to a new server which would allow it to run on port 80.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 22, 2006, 07:02:09 pm
The comps I tried it on have free access to all ports, had the same thought first.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 27, 2006, 09:55:45 pm
Any other way then SVN to grab the current sources?
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: buff on March 28, 2006, 01:36:39 am
can't connect to SVN also... no idea why
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on March 28, 2006, 02:59:58 am
SVN is now currently down since Friday. Due to unforeseen issues, it will take me at least a few days to get it back up again. Im waiting for a DVD backup to arrive to allow me to reconstruct the SVN in a new location.

In the meantime, the latest release in the News section is an almost 100% up to date copy of the repository.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: phx49331 on March 28, 2006, 03:32:08 am
ok just setup v3.2 and all my i get this "I only listen to members of this bot."
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on March 31, 2006, 03:20:33 pm
Working on the tablenames based on 0.3.2 then.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: MatHack on April 05, 2006, 05:14:28 pm
SVN seems to be down or moved (and startpost not updated), I keep getting the following error for about a week now:

Code: [Select]
svn: PROPFIND request failed on '/svn/BeBot/trunk'
svn: PROPFIND of '/svn/BeBot/trunk': could not connect to server (http://svn.shadow-realm.org:7100)
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: kuznechik on April 13, 2006, 01:50:43 am
Found reason why my 0.2.2 bebot won't log tower attacks if attacker belongs to org... Checked 0.3.2, found strange, but 100% not working regex too.

Patch for 0.2.2:
Code: [Select]
--- TowerAttack.php.orig     Thu Jun  2 16:38:47 2005
+++ TowerAttack.php      Thu Apr 13 03:11:57 2006
@@ -165,7 +165,7 @@
       $attack = false;
       $victory = false;

-      if (preg_match("/The (clan|neutral|omni) organization (.+) just entered a state of war!  (.+) attacked the (clan|neutral|omni) organization (.+)'s tower in (.+) at location \(([0-9]+), ([0-9]+)\)/i", $msg, $info))
+      if (preg_match("/The (clan|neutral|omni) organization (.+) just entered a state of war! (.+) attacked the (clan|neutral|omni) organization (.+)'s tower in (.+) at location \(([0-9]+),([0-9]+)\)./i", $msg, $info))
       {
         $off_guild = $info[2];
         $off_side = $info[1];


This is regex from 0.3.2. I'm not regex pro, but (Clan|Neutral|Omni) mustn't be capitalised, there is "," between coords and "." after.
Code: [Select]
if (preg_match("/(.+) \((Clan|Neutral|Omni), (.+)\) attacked (.+) \((Clan|Neutral|Omni)\) at (.+), ([0-9]+)x([0-9]+)/i", $msg, $info))
This is tower attack message I used for reference:
Code: [Select]
[All Towers] The clan organization NemX just entered a state of war! Kyodaai attacked the omni organization Core's tower in Belial Forest at location (1954,387).
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Xenixa on April 13, 2006, 06:11:31 pm
That was fixed for 0.2.x versions here kuznechik: http://bebot.link/index.php/topic,203.msg991.html#msg991
Basically just added some ucfirst(strtolower()) functions.

Also somewere around here was a rewritten TowerAttack.php by Crazied that I use now. :)

Found it: >> http://bebot.link/index.php/topic,243.0.html
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: KingJ on April 21, 2006, 09:12:35 pm
Hmm, just upgraded to 0.32, everything seems to work fine except for the fact that the bot does not respond to commands in the org channel, only through tells.

Is there a way to fix this?
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: MatHack on April 22, 2006, 12:49:19 am
/tell yourbotname !commands

if ! is your prefix.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: KingJ on April 22, 2006, 10:03:21 am
Ah, I see now. Now to figure out what G, M, SA, A and RL mean...

Edit: Set all of the to G (For Guild?) and it seems to be working fine. Thanks! (Love the new online screen  :D)
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Pharexys on April 22, 2006, 02:12:40 pm
As far as I understood myself, G = Guest, M= Member, A= Admin, SA = Super Admin
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Alreadythere on April 22, 2006, 05:59:13 pm
Right.

Guest means everyone.
Member is everyone that has is_member() != 0.
Admin/SA means the groups.

If you add another group, it can be used for command rights too.

One note - if you are allowed to execute a command due to membership in one group, you can execute it.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Feanaro on May 06, 2006, 06:16:43 pm
is SVN still down?
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on May 08, 2006, 06:15:52 pm
SVN still down. I never got time to work on it while in the US.

Planning to get it back up this week once i get a list of piled up issues taken care of.
Title: Re: Bebot 0.3.x Development [release 0.3.2]
Post by: Khalem on May 13, 2006, 04:23:28 pm
SVN back up at new location.

Browsable interface: http://svn.shadow-realm.org/
SVN checkouts: http://svn.shadow-realm.org/svn/BeBot
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on May 18, 2006, 09:56:36 pm
Release 0.3.3. See first post.

This is a security release that addresses a directory traversal issue in the help module.
The issue was discovered by Somebotty @ irc.funcom.com and brought to my intention on May 18th.
In the course of the evning the vulnerability was properly identified, tested, and a fix applied and then tested.
While this may sound serious (and all directory traversal bugs are) it is mitigated by two factors.
- It is only possible to access .txt files trough the HELP function
- On Unix systems it is further mitigated by the user input being lowercased. As Unix systems are case sensitive this makes it even harder to exploit.
There are no known ways to exploit this issue due to the mitigating factors, but non the less we are releasing a version with this bug fixed.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: jjones666 on May 23, 2006, 01:13:39 pm
Hi Khalem,

SVN #103, does also also include the updates by Xenixa here: http://bebot.link/index.php/topic,210.0.html ?

Cheers,

-jj-
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on May 23, 2006, 03:20:00 pm
Just commited that to r108 along with a bugfix.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on May 25, 2006, 01:13:18 pm
Be sure to keep an close eye on deleted and moved files right now if you are playing with the SVN versions as there are a lot of changes going on.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Alreadythere on May 25, 2006, 04:21:51 pm
Bleh, and now I'm almost done with a get_/define_tablename implementation based on 0.3.2, only got to test for syntactical correctness by doing a few more drystarts of the bot.

Hope you can include that fairly easy still.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on May 25, 2006, 08:09:02 pm
Should not be a problem im sure.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on June 13, 2006, 04:36:43 am
Heads up.

I just committed the latest AOChat library minus the new chat queue (i havent had time to look at the chat queue changes yet) and AUNO changed around the format of some of the EXT messages. As such it breaks just about all modules that parse EXT messages like tower attack module, org city etc.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Vhab on June 13, 2006, 06:43:15 am
changed around the format of some of the EXT messages. As such it breaks just about all modules that parse EXT messages like tower attack module, org city etc.
Can't these plugins use the parsed args instead of reparsing the string?
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on June 21, 2006, 02:27:45 pm
Heads up. SVN will be broken out of the box for a little while.

If you grab SVN, make sure to disable or delete the new module named Roster.php, it will conflict with the old and is incomplete.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on June 30, 2006, 08:55:29 pm
SVN should now be back in working order for GUILD bots only. Raid bot roster handeling is still not updated and wont run at all right now.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 04, 2006, 05:24:44 pm
Please note. The coloumn name in the whois table has been renamed to nickname. Drop the whois table or preform a manual rename.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 14, 2006, 09:34:39 pm
Experimental Raid Roster is now in SVN. You will need to uncomment a die() call to test it to prevent people with no clue from running the code.

Also made some updates to the Guild Roster to make it more sane.

Guild Roster is running stable and seemingly working fine on my own guildbot, so i think its safe to say the code is ready for wider testing now.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 25, 2006, 12:39:17 am
Table prefix support has now been added to SVN.
This code is currently untested and might contain bugs.

When using this revision please observe:
All custom modules must have their database queries updated in order to support prefixes. The change is simple, prefix table names with #___ (thats 3 underlines) which in turn will be parsed by the MySQL layer.

You will want to manually add a prefix to your tablenames (except the whois table which intended to be shared between bots), or alternatively, set the prefix to be empty.

The following should be added to your MySQL.conf:
Code: [Select]
  $master_tablename = "botname_tablenames"; // Name for the table containing all other tablenames
  $table_prefix = "botname"; // default prefix for tablenames
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 25, 2006, 05:48:53 am
And i thoroughly broke SVN :P

The parser callback function worked fine during testing when i wrote it, but it seems im missing something obvious somewhere.
It would seem you cant have a callback function inside a class, unless the class itself is the callback.
And if i move the callback outside of the Class, i run into problems calling the functions i need which is inside the class O.o.

If anyone with more php experience wants to take a look at current SVN, in particular Sources/MySQL.php feel free to.
I'm going to bed and hoping to find some solutions in the morning.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 26, 2006, 04:29:16 am
SVN back in working order with working table prefix support
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Alreadythere on July 28, 2006, 02:11:36 pm
Neat idea that prefix, makes SQL calls less spammy.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Stelai on July 29, 2006, 04:10:14 pm
Is it me or SVN can't be reached ? :)
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on July 29, 2006, 04:32:23 pm
SVN is unreachable at the moment. I'll see if i can find out whats going on with the server.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on August 20, 2006, 12:06:33 pm
Small update on change in plans.
0.3 will be branched off to 0.4.0 stable sooner than planned to get much needed updates in the roster and whois handling out to the general public.
The MySQL layer overhaul and new command hooks thus is being pushed into the next development branch which will be 0.5
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on August 20, 2006, 04:43:00 pm
Heads up.

Filename changes in SVN:
main.php -> Main.php
start.php -> StartBot.php
start.bat -> StartDebugBot.bat

Added StartBot.bat which will call StartBot.php instead of Main.php
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on August 20, 2006, 05:08:12 pm
Outstanding issues on my list right now:
- Admin.php needs to be updated
- Guest management needs to be updated and put into its own module
- Raid bot roster needs more testing (if your brave, please help and give feedback)
- RightsManagement needs to be fixed so it will correctly set the default access levels on first startup
- Smarter error messages on command failures instead of blindly sending !help (or in the case of Guildchat and Pgroup, nothing at all)

It's a relatively short list, so we are getting close to the next snapshot.
Admin.php and Guest management are things that must be done before the next development release as they are useless in the current state.
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: dogEATdog on October 18, 2006, 05:34:08 pm
still though, excellent bot....just had to do a few minor changes to my database.  I like it much better than 0.2.x.   Didn't realize I had to set permissions at first to have it listen in org channel for basic members, but I REALLY REALLY like that feature.  A++ IMO
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Naturalistic on October 19, 2006, 03:51:59 am
3.x will soon be in full development ;)

So keep an eye out for this big upgrade :D
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Khalem on October 19, 2006, 09:01:49 pm
I'm not dead, just have a lot going on.

Making preparations to open up development more than it is today allowing contributors to make direct contributions if they want to, making it even more of a community effort, even though i think the community has done more to the bot than myself already :)
Title: Re: Bebot 0.3.x Development [release 0.3.3]
Post by: Naturalistic on October 20, 2006, 07:26:55 am
*holds onto Khalem for moral support*

You've been doing great, Khalem, it *is* all voluntarily ;)
Title: Re: Bebot 0.3.x Development [release 0.3.4]
Post by: Khalem on June 11, 2007, 01:00:50 am
0.3.4 released.
Title: Re: Bebot 0.3.x Development [release 0.3.5]
Post by: Khalem on July 01, 2007, 10:37:16 pm
0.3.5 released
SimplePortal 2.3.7 © 2008-2024, SimplePortal