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

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

Author Topic: Bebot 0.3.x Development [release 0.3.5]  (Read 40032 times)

0 Members and 3 Guests are viewing this topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Bebot 0.3.x Development [release 0.3.0]
« Reply #15 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.
BeBot Founder and Fixer Kingpin

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #16 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 :)

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #17 on: November 18, 2005, 12:40:22 am »
Looking forward to relay being automatically turned on when bot loads =)

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Bebot 0.3.x Development [release 0.3.0]
« Reply #18 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 :(
BeBot Founder and Fixer Kingpin

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #19 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.

Offline Zarkingu

  • Contributor
  • *******
  • Posts: 34
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #20 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.
Zarkingu 210 MP RK2

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Bebot 0.3.x Development [release 0.3.0]
« Reply #21 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.
BeBot Founder and Fixer Kingpin

Offline Zarkingu

  • Contributor
  • *******
  • Posts: 34
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #22 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. :)
Zarkingu 210 MP RK2

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Bebot 0.3.x Development [release 0.3.0]
« Reply #23 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.
BeBot Founder and Fixer Kingpin

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #24 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
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #25 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?

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #26 on: November 28, 2005, 03:40:05 am »
Exactly why I didn't add 1 Sec Cron jobs ;)
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #27 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.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Bebot 0.3.x Development [release 0.3.0]
« Reply #28 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.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Bebot 0.3.x Development [release 0.3.0]
« Reply #29 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 :\
BeBot Founder and Fixer Kingpin

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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


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

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

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