BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => AO 0.6.x Custom/Unofficial modules => Topic started by: Temar on January 11, 2009, 07:51:58 pm
-
Slaves Module
This is a Module that will enable Slaves
Basically this is log in more character to handle buddy list
This unique Feature about this is its only a module, making handling of the buddy list much better, it runs with the bot
Currently Only Supports Buddy list handling, stuff like useing slaves for !announce is coming soon
you must Place this module in /main/
to add slave bots add them to your conf file
$slaves[] = array("username", "password", "botname");
add that line for each slave
Also you should modify the $cron_delay in your .conf file
i advise 30 seconds per per 1k users on notify
Current MAX supported slaves = 5
ToDo
- Add ability for Slaves to Access commands by simply redirecting them to main functions and main bot takes over
- Add a Setting as to what you want the Slave to do when receiving tell
- Add a Setting for if slaves for help with sending of tells
Download
http://www.aofiles.com/index.php?action=user_file&owner=temar&file=Slaves
Change Log
- 11/01/09 [1.0] - 1st release
- 13/01/09 [1.1] - classes are not loaded if slaves are not defined
- 13/01/09 [1.1] - Fixed issue with users not being assigned to a Slave
- 13/01/09 [1.1] - Fixed login of Slaves
- 13/01/09 [1.1] - buddies are now added to correct bot is already assigned to 1
- 13/01/09 [1.1] - slaves now send tells that the main cannot due to spam limits
- 22/01/09 [1.2] - now only reasignes buddies when the roster is going to run
- 22/01/09 [1.2] - each bot now has 1 second each for communication instead of 2
- 22/01/09 [1.2] - Fixed issue were messages that were cut only went to main bot
- 22/01/09 [1.2] - send_gc is now available for slaves but not used by this module
- 23/01/09 [1.3] - Now checks users already on buddy list after running reasign
- 23/01/09 [1.3] - Fixed Buddy online and buddy exists functions
- 23/01/09 [1.3] - Fixed Roster update Control Class
- 25/01/09 [1.4] - Fixed split function
- 09/05/09 [1.5] - Fixed some issues in send_tell function
- 04/10/09 [1.7] - Added Reconnect Support for Slaves
When Reporting Bugs about bot even if you think its not this Module you Should Say you are using this module as this module gets involved with alot of core coding and can create unexpected errors
-
Hey Temar, I'm just trying to understand what exactly this module is and the possible benefits of using it, but I think my brain must be running low on IQ at the moment, would you mind making me a examples or two for dummies in regards to slaves? Thanks m8 ???
-
there is a buddy limit of 1000, not 100% sure this is true for AoC also but probably is
the slave bot ill use extra characters to increase that buddy limit
and soon i plan on useing the slaves to send mass messages also, making them faster
on RK1 i have a raidbot with over 1400 members
im also part of a Big raid bot with over 2500 members, which will be useing this module
-
Thanks for this module Temar, it was right in time=)
I removed my two "Post before checking it out" post and i will try to give you a buglist.
What i could see before EU server went down for merge was this bug whenever i used a command on Mainbot:
Warning: Missing argument 4 for Slaves::log(), called in \main\00_BotError.php on line 74 and defined in \main\02_Slaves.php on line 1624
Mainbot [2009-01-13 21:05:38] [security] [Undefined function check_access(Getrix, OWNER)!]
Mainbot [2009-01-13 21:05:38] [TELL] [OUT] -> Getrix: The bot is restarting.
Current error is from using "!restart". But it will give this error if i do a "!whois" also.
-
Trying to install this on a very new 0.6.1 bot and getting:
Warning: Slaves::require(conf/ServerList.php): failed to open stream: No such file or directory in /home/bots/bebot/bebot-0.6.1/main/02_Slaves.php on line 435
Fatal error: Slaves::require(): Failed opening required 'conf/ServerList.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/bots/bebot/bebot-0.6.1/main/02_Slaves.php on line 435
I looked for a file of that name but I don't see one anywhere.
-
just verifying temar, this basically allows another bot to act as buddylist overflow, and passes messages to the main bot.
clash has 1400 members
so clashbot has 999 buddies plus the slave "clashbot2"
clashbot2 which is technically invisible, has 401 buddies
clashbot2 just passes the messages back to clashbot.
Now are these messages passed via DB, or through tell or PG?
I'm curious as to what it may do to alliance relays...
also as this is going in the conf file, then clashbot loads clashbot and clashbot2, instead of a separate bot running...
Am I right, or am I missing something?
-
hyde you need the latest 0.6 files below
/conf/ServerList.php (http://svn.shadow-realm.org/index.py/BeBot/branches/0.6/conf/ServerList.php?view=co)
/Source/Bot.php (http://svn.shadow-realm.org/index.py/BeBot/branches/0.6/Sources/Bot.php?view=co)
clashbot
the buddies are shared even so thats 700 on main and 700 on slave
this is a module that is loaded on main bot, so basicly its internal and will not affect any other stuff like relays
this also uses slaves for sending of tells when main is unable to
-
k, good that will get rid of the buddy clean mod then...awesome!
-
Beautiful. Installed the 3 files from this thread, created 2 slave bots, configured everything and my orgbot automatically distributed the buddies across all 3 bots. I love it ... especially the fact that they're all controlled by the master bot.
My org's buddy capacity just doubled, which fixes so many problems, since we were over the 1600 mark in our main org.
Thank you :)
-
I am seeing alot of spam in the console, like:
Total Count: 14639
Count: 1
I'm assuming its a debugging thing for now. Just post when there is a new version, I'm subscribed. Going to keep using this one for now :)
-
yer there is alot of debug stuff left in
the thing u are seeing is usually output hourly when another module chec the buddy list
its basicly a count of each buddy list for each char and then a total
-
1.2 released
see 1st post
-
We might re-write Elitenet on ur module :D
I didnt tested yet but looks good :D
We had big problems with Buddy's while porting to 0.5, so we give up :D
-
We might re-write Elitenet on ur module :D
Off-topic: WTB Elitenet and Neutnet hooking up and having a child, then dying ... we don't really need both, they duplicate each other.
-
i dunno about that one :D is it up or on-making?
Anyway, bump for Temar :P
-
1.3 released
-
I'm still on 1.1, I'll update to 1.3 this weekend, but I'm wondering if this was a known bug on 1.1 (therefore fixed) or not? Hopefully its part of the 1.3 "fixed buddy online" note.
I've got "ghosts" in !online. These are people who were on !notify when they logged on but then turned !notify off and logged shortly thereafter (not sure if logging makes a difference). I'm sure that's the case since 3 of the 5 people on !online today who weren't really online were my mules that I had logged on yesterday, immediately turned off !notify when I saw them announced, and then logged off within a minute or two.
I don't -remember- these happening in 0.6.1 before but I was only running it for a couple of days on the big orgbot before installing slaves.
To get the ghosts off !online I have to turn them back on notify while they are offline, then turn their notify back off.
-
There was a bug in notify creating online ghosts. The fix coming with 0.6.2 might help you in this case too.
-
Upgraded to 1.3 today. Will yell if I see more problems but seems to have fixed my ghost issues (or 0.6.2 did, not sure). Will be easier to be sure in a day or so.
I am still seeing alot of "Total" / "Count" spam when starting the bot. I can live with it, just making sure it is an expected behavior.
-
wat do u mean by alot?
as far as i know you should see a count(1 per bot) and a total, 2 maybe 3 times when bot runs 1st cron and then once every hour, unless triggered by user action
i dont plan on removing it yet as its very help bull with seeing how many on each bot, howeva i will compact it for 1.4
-
Between the time where I see:
Botname [2009-01-25 07:37:20] [CORE] [INC_GANNOUNCE] Detected org name as: Athen Paladins
and the bot announces itself on orgchat I did a grep/wc and found 71 times where it did a "Total Count:" + "Count:" pair of lines.
Example (these are the first 3 entries from starting the bot up):
Total Count: 44763
Count: 1
Total Count: 44764
Count: 1
Total Count: 44765
Count: 1
-
yep i see this at a high volume also just as a point i actually see it all the time, its just counting up constantly even after the bot start.
Mybot [BUDDY] [LOG]
Total Count: 58105
Count: 1
Total Count: 58106
Count: 1
Mybot [BUDDY] [LOG]
Total Count: 58107
Count: 1
Total Count: 58108
Count: 1
Mybot [BUDDY] [LOG]
Total Count: 58109
Count: 1
Total Count: 58110
Count: 1
Mybot [BUDDY] [LOG]
Total Count: 58111
Count: 1
Total Count: 58112
Count: 1
Mybot [BUDDY] [LOG]
-
thats not the slave module, thats a stats module
its counting number of times it reads a site page
howeva im unsure as to what is getting for when some 1 logs on for AoC
there is a setting to turn off, !set Statistics
-
1.4 released with Fix for issue with split messages
-
do we have a new link for this?
-
also does the slave have to be an org member as well? Same side? As all the security and settings are controlled by the master bot, am curious if org and faction are a factor.
-
It's something Bebot surely needs, buddylist sharing among slaves.. but i don't agree this is the way to do it.
This module contains all the code to start up a bot, instead of using the available code (in core/ and modules/ etc) we have. What a module like this _should_ do, is extend the current roster/buddylist stuff.
The fact that you're creating a complete bot in 1 module limits it too. Like you said, you want to add !announce and stuff like that.. if it was a normal bot, offering it's buddylist to a main bot, that other bot could help out way more easily.
I hope i get some time soon to start coding again, your module has some interesting stuff in it. I'm curious to see how tiny i can make a module like this.
What i still gotta look into, is how you work around a bot which allready has around 999 buddy's on it's buddylist, and you then add slaves..
core/User.php has:
$this -> bot -> core("chat") -> buddy_add($members["id"]..
..without checking if it hit it's limit, and where it needs to go to. So how can the master bot know which bot hit the limit.. all a bit vague now.
-
laen: While you make a good argument it's alot easier said than done.
Infact, that exact question lead me to create VhaBot which is build around the concept of having slave bots directly in the core, allowing plugins to use them without being aware of slaves being present.
(Though, this is disabled in the binary releases to prevent large scale usage of slave bots)
To implement something like this into BeBot it'll probably take a good look at the core and redesign that to make it use slaves internally.
I do believe it's doable while keeping the same outer API, though it probably needs to be extended for plugins that do wish to be aware of the different cores.
2 things are quite reasonable to implement into the core of the bot: extended friendlists and automated load balancing on slaves.
The rest would require a partial redesign of the API probably.
Untill such thing is made into the core of BeBot, this plugin is probably as close as it gets to having slaves for BeBot.
Then again, I don't fully know how this plugin works and how close to the ideal situation it is.
-
the main reason there is alot of code that could be else were in this module is simply because i wanted this it be a simply plug and play module, no modification to existing modules required
and to answer clashbot question, generally no as the slaves are only used for buddy list and tells, which doesnt matter wat faction/org you are
-
thanks, that will make it easier to implement.
-
Version now 1.5
-
My bot in AoC has reached 1k buddys, so I thought I would try out this module.
However I get this error:
Fatal error: Call to undefined method AOChat::authenticate() in .../main/02_Slaves.php on line 481
I'm running 0.6.3..
Edit: Tried it with 0.6.4, and the problem now, is that it tries to logon the slave bot too fast.
So, how can I make it wait for about 2 minutes before it logs on slave bot?
-
The slaves module will likely not work because of the reason you stated. However it should be possible to change the way it operates by changing the connect routine to be triggered by a cronjob running 5 minutes after the bot starts or so.
I don't have time to look into it atm however.
-
should be easy to change to that, it always worked fine as it was now for my bots and others i know of for AO
so im guess its todo with AoC
i issue i see with having them connect at cron instead is the stuff that react to buddy actions, like new being sent. it may send news to people on bot start
also need to make sure it logs them in before other stuff like roster or they might be other problems
the module interacts directly with the main while() function of the bot, being a delay can be added with out use of cron
-
Thanks for update! (1.7)
-
I am getting this error on only one of the bots that I am running, and this particular bot isn't even using a slave..
fatal error: call to a member function update_buddy_cache() on a non-object in 02_slaves.php on line 2462
Any ideas what could be causing it?
nevermind...found my issue, had an old version of slaves....just odd that only one bot had a problem
-
i will double check that the module is properly disabled when no slaves
-
Im having a slight problem getting this to run on my new server, if its cause its x64 or that i need to open any ports i dont know, or could it be PHP thats blocking the script from running more concurrent connections?
MAIN [2010-04-04 18:39:31] [LOGIN] [STATUS] Connecting to ao server chat.d1.funcom.com:7101
MAIN [2010-04-04 18:39:31] [LOGIN] [STATUS] Authenticating MAIN
MAIN [2010-04-04 18:39:32] [LOGIN] [STATUS] Logging in MAIN
MAIN [2010-04-04 18:39:32] [LOGIN] [RESULT] OK
SLAVE [2010-04-04 18:39:32] [LOGIN] [STATUS] Connecting to server chat.d1.funcom.com:7101
SLAVE [2010-04-04 18:39:32] [LOGIN] [STATUS] Authenticating SLAVE
SLAVE [2010-04-04 18:39:33] [LOGIN] [RESULT] Error
AOChat: Authentication failed: Challenge failed
-
its working fine on tnet
the account your logging into is ok right?
-
Yeah, but this is only on my new server.
Exact same bot (copy) runs perfect on my old server.
So question is could it be firewall or maybe that php / apache not configured right?
-
Funcom is refusing your authentication attempt.
Verify your username and password for the slave(s).
-
Yeha that was my first thought also, if i switch MASTER and SLAVE master will login like above but not the slave.
(i'we also tried with same account but 2 chars, aswell as 2 different account's)
I also tried trying wrong password just for the heck of it, i then geat a clear error saying wrong username or password.
AOChat: Authentication failed: Illegal alias or password
EDIT: I'we also tried adding a sleep so which it does not try to connect instantly after the other bot. (and while i still am struggling im only trying to use 1 slave)
EDIT2: On my desktop machine running WAMP its also running perfect.
-
Since its a VDS / VPS i will reset it to windows 2008 and try with WAMP on it, ill be back with feedback on how it goes :)
-
Odd.
It would seem there is something system specific then which is causing issues only with the slaves module.
-
Yes, it seems so, i now setup my Windows 2008 R2 with WAMP and bot runs as it should cept im getting so manny warnings its not even funny.
Im guessing iwe gotten a few thousand warnings already and bot has then only been running for a little while. "Notice: Undefined property: ...." But those are PHP debug warnings? (i started bot with Main.php)
-
The error logging level is set in your php.ini
0.6 will produce a large amount of notices/warnings, and a lot of work has gone into fixing all those in the 0.7/0.8 branch
-
Odd.
It would seem there is something system specific then which is causing issues only with the slaves module.
I know this topic is an old one, but I am having this issue now after migrating my bots over to a 64bit Fedora Linux system.
As there was no *fix* noted in this thread, I am re-starting it to see if anyone had a chance to look into this? I compared the login/authenticate code bits from the Bot.php and this 02_Slaves.php module. I did note some differences. Will try to get more details when I can do more troubleshooting.
This works fine running under 32bit OS.
Shelly
-
I looked through this module and couldn't see the problem.
If you don't find a fix, you could try the AO Chat Proxy program that I wrote. I wrote it for Budabot, but it should work equally well for Bebot also.
http://aodevs.com/forums/index.php/topic,870.0.html
-
Thanks Tyrence!
I did get it to work. I even took it one step further... Because I run multiple bots, I created a proxy for each series of bots (on different ports of course). I run Linux Bots, so this may not work for windows...
The Mods:
conf/ServerList.php Add the localhost lines "Proxy-*"
<?php
// AO
$server_list['ao']['Testlive'] = array('server'=>'chat.dt.funcom.com', 'port'=>7109);
$server_list['ao']['Atlantean'] = array('server'=>'chat.d1.funcom.com', 'port'=>7101);
$server_list['ao']['Rimor'] = array('server'=>'chat.d2.funcom.com', 'port'=>7102);
$server_list['ao']['Die neue welt'] = array('server'=>'chat.d3.funcom.com', 'port'=>7103);
$server_list['ao']['Proxy-1'] = array('server'=>'localhost', 'port'=>9991);
$server_list['ao']['Proxy-2'] = array('server'=>'localhost', 'port'=>9992);
$server_list['ao']['Proxy-3'] = array('server'=>'localhost', 'port'=>9993);
In your bothome/conf/Botname.Bot.conf file change your dimension to 4,5, or 6 depending on which local port you want to use from above:
$dimension = "4"; // The name of the server you play on, or (1, 2 or 3 for AO)
In bothome/Sources/Bot.php between Line 219 & 220 Insert (leave off the "Default:"):
case "4":
$dimension = "Proxy-1";
break;
case "5":
$dimension = "Proxy-2";
break;
case "6":
$dimension = "Proxy-3";
break;
Default:
Then for each Proxy create a separate folder (Proxy-1, Proxy-2, Proxy-3 ... for instance)
In each folder edit the chatbot.properties file and change the proxy to match what you set in the bothome/conf/Botname.Bot.conf file. Follow the instructions Tyrence supplies with his code for the proper settings.
chatbot.properties example:
proxyPortNumber=9991
serverAddress=chat.d2.funcom.com
serverPortNumber=7102
bot1_username=BOT_ACCOUNT
bot1_password=BOT_ACCT_PASSWORD
bot1_characterName=BOT_NAME
bot2_username=BOT_ACCOUNT2
bot2_password=BOT_ACCT2_PASSWORD
bot2_characterName=BOT_NAME2
So... in my example
1. Bot1 (uses port 9991 -- A.K.A. Proxy-1) so the bothome/conf/Bot1.Bot.conf file uses dimension(4)
2. The bothome/conf/Bot1.Bot.conf file lists your main chatbot character which is also entered as bot1_* entries in the Proxy-1/chatbot.properties file. (see above)
3. What you would have placed in the bothome/conf/Botname.Bot.conf file in the "slaves lines" goes into the bot2_*, bot3_*, ect.
4. Start your Proxy up ... I suggest "cd Proxy-1; nohup chatbot.sh &"
5. Start your Bot1 bot up and watch the magic!
Many thanks to Tyrence for his work on the proxy application!
Shelly
-
I am going to try using this mod on one of my AoC bots. Anyone have any advice or things to watch out for?
~Kyr
-
I am going to try using this mod on one of my AoC bots. Anyone have any advice or things to watch out for?
~Kyr
Hey Kyr,
Sorry I don't have much experience with AoC bots, but your should be able to modify the AOC lines like I did for AO.
Read the guide Tyrence has for install would be the best answer I could give.
Shelly
-
For this to work in 64bit (*nix atleast) you need to change line 405 from
if (!$this -> aoc[$num] -> connect($server, $port))
to
if (!$this -> aoc[$num] -> connect($server, $port, $this -> bot -> sixtyfourbit))
so it knows wether it's on a 64bit system or not.
All I had to change in the module to get it to work :-)
Attached fixed 02_Slaves.php
-
For this to work in 64bit (*nix atleast) you need to change line 405 from
if (!$this -> aoc[$num] -> connect($server, $port))
to
if (!$this -> aoc[$num] -> connect($server, $port, $this -> bot -> sixtyfourbit))
so it knows wether it's on a 64bit system or not.
All I had to change in the module to get it to work :-)
Thanks! That works beautifully!
Shelly
-
To make slaves work on the new servers, change function connect2($num) part of main/02_Slaves.php (around line 366) to also contain
case "5":
$dimension = "Rubi-Ka";
break;
like this:
function connect2($num)
{
// Get dimension server
switch($this -> bot -> dimension)
{
case "0":
$dimension = "Testlive";
break;
case "1";
$dimension = "Atlantean";
break;
case "2":
$dimension = "Rimor";
break;
case "3":
$dimension = "Die neue welt";
break;
case "5":
$dimension = "Rubi-Ka";
break;
Default:
$dimension = ucfirst(strtolower($this -> bot -> dimension));
}
-
I tried to install that module ..... and after I fixed some Errors it seems to work..... but then there was a strange notice in terminal....
Bot [2014-01-31 06:23:48] [LOGIN] [STATUS] Connecting to ao server chat.d1.funcom.com:7105
Bot [2014-01-31 06:23:48] [LOGIN] [STATUS] Authenticating bot
Bot [2014-01-31 06:23:50] [LOGIN] [STATUS] Logging in Bot
Bot [2014-01-31 06:23:50] [LOGIN] [RESULT] OK
Bot1 [2014-01-31 06:23:50] [LOGIN] [STATUS] Connecting to server chat.d1.funcom.com:7105
Bot1 [2014-01-31 06:23:50] [LOGIN] [STATUS] Authenticating bot1
AOChat: 91a092cb96e553244e728c3ebda0ac03
then the bot automatic restarts.....
any1 has an idea how to fix this or an idea what this could be ? Oo
the function which gives the notice is in AOChat.php line 629:
// If we recieve anything but the character list, something's wrong.
if ($packet->type != AOCP_LOGIN_CHARLIST) {
die("AOChat: {$packet->args[0]}\n");
}
please help me :) .....
-
Maybe my slaves module is broken :'( .... can some who's got a working module upload it for me pls.... :)
-
I only took the last posted version and added the lines Heffalomp said and it seems working on my linux system. maybe you just want to diff it with your version, so modules attached
-
So to complement this (old) topic, there seems to have 2 ways to extend 1K friendlist with slaves on Bebot 0.6.x :
1/ the Slaves.php module posted upper by Heffa that will implement several connection on different toons in order to allow main bot to obtain 1K extension per slave ; this implementation is somehow simple but also quite heavy as it will recreate a limited bot per slave ; sidenote is the difficulty about PHP 7 portability for Bebot 0.7, but may work for AOC*.
2/ the AoChatProxy service proposed earlier by Tyrence that will let you run a localhost connection proxy with its own parameters in order to obtain 1K extension per slave ; this implementation is indeed more complex but also rather light as the slaves ain't bots for real ; sidenote is the easy way to port it PHP 7 and Bebot 0.7, but works only for AO.
-----------------------------------------------------
Therefore, for AO, i suggest solution 2/ by :
Creating the main bot + all its needed slaves in froob accounts.
Downloading AOCP at https://github.com/Budabot/AOChatProxy
(If none yet, you may also need to install Java JDK for your OS)
Configure within config.properties (copied from template) with :
- proxy local port (9993 by default, advised unless you know why you change)
- server distant adress & port (according to what game/dimension you need)
- all the slaves you want starting at number one (with user, pass, name)
Once ready, run the service (run.bat on windows, run.sh on linux/mac).
Then the service should be waiting for main bot connection ...
Then edit the bot following files :
conf/Serverlist in which you should add at least the line you need :
$server_list['ao']['AoTestProxy'] = array('server'=>'localhost', 'port'=>9993);
$server_list['ao']['AoLiveProxy'] = array('server'=>'localhost', 'port'=>9993);
$server_list['ao']['AoRk19Proxy'] = array('server'=>'localhost', 'port'=>9993);
$server_list['aoc']['AocProxy'] = array('server'=>'localhost', 'port'=>9993);
Sources/Bot.php in which the top switch should be added AO block you need :
case "90";
$dimension = "AoTestProxy";
$this -> dimension = 0;
break;
case "95";
$dimension = "AoLiveProxy";
$this -> dimension = 5;
break;
case "96";
$dimension = "AoRk19Proxy";
$this -> dimension = 6;
break;
Finally edit you conf/Bot.conf and set $dimension to the correct value :
For AOC it's a name : $dimension = "Aocproxy";
For AO its a number, e.g. for Live Proxy : $dimension = "95";
Now, run main bot and it should connect along with all slaves.
(This may take long especially the first time with huge list ...)
Therefore the resulting friendlist limit is now 1k x (main + X slaves).
E.g. with 4 slaves : 1k x (1+4) = 5k
NB : for Bebot 0.7.15+ please check the Readme on Sandbox https://github.com/bitnykk/BeBot and/or Official https://github.com/J-Soft/BeBot/
-
* : after many tests, seems the slaves modules works for Bebot 0.6 on AO but won't be appliable for AOC in Bebot 0.7 ; therefore here are my conclusions :
Bebot 0.6 :
- AO => can use slaves module OR AoCP solution
- AOC => might use slaves module only (need testing)
Both are documented within this thread upper.
Bebot 0.7(.15 patch incoming) :
- AO => must use AoCP solution
- AOC => will be provided with a new tailored solution
Both are documented within 0.7 Readme from Git.