Editing Friendlist

From Bebot Wiki 2
Jump to navigationJump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 20: Line 20:
 
     $slaves[] = array("account", "password", "Character);
 
     $slaves[] = array("account", "password", "Character);
  
More details in this archived topic http://bebot.link/ao-0-6-x-customunofficial-modules/slaves/
+
More details in this archived topic http://bebot.shadow-realm.org/ao-0-6-x-customunofficial-modules/slaves/
  
  
Line 32: Line 32:
  
 
Both solution are detailed within 0.7 Readme from Git https://github.com/J-Soft/BeBot/ (official) or https://github.com/bitnykk/BeBot/ (sandbox)
 
Both solution are detailed within 0.7 Readme from Git https://github.com/J-Soft/BeBot/ (official) or https://github.com/bitnykk/BeBot/ (sandbox)
 
For Aocp, principle will be to run a companion service accessible by setting up target server number plus 90 (so 95 for RK5, eg).
 
 
More details are provided in the upper Readmes (on any of both github repos).
 
 
 
== AoCp ==
 
 
If you choose this great solution, it may bring some rare but unwanted miscommunication issues, e.g. after a server downtime, that could occasionnally make the bot unable to speak with its proxy, or stucked at reboot, or proxy in error, etc.
 
 
The best way to fix any of these is to setup the bot and its proxy under a service each (linux prefered from far in this !) as explained on bottom of installation page http://wiki.bebot.link/index.php/Installation
 
 
Once this is done and working, you should (1) set a module into the bot that helps proving it's is still online and alive plus (2) another croned server script that will check bot life proof every minute and possibly take measures in case of issue.
 
 
1: our suggested bot module is into Custom/Modules and is named HeartBeat.php ; just remove its initial _underscore to activate it and restart the serviced bot. From there the bot should update a .txt file of its own name at startup and then every 5 minutes.
 
 
2: from there you only need to cron the server life checker script. Cron would be like :
 
* * * * * /path/to/script.sh
 
And this executable (chmod +x) script should contain stuff as :
 
#!/bin/bash
 
file=/path/to/bebot/Custom/Modules/Botname.txt
 
current=`date +%s`
 
last_modified=`stat -c "%Y" $file`
 
if [ $(($current-$last_modified)) -gt 999 ]; then
 
      /bin/systemctl stop botname.service;
 
      sleep 2;
 
      /bin/systemctl stop aocp.service;
 
      sleep 2;
 
      /bin/systemctl start aocp.service;
 
      sleep 2;
 
      /bin/systemctl start botname.service;
 
fi
 
As you see, if after 16 minutes there's no proof of bot life, this script would cleanly close both bot then proxy, and then relaunch both proxy then bot (in that wanted stack order, with 2 seconds delay to make sure processes are loaded and ready to communicate).
 

Please note that all contributions to Bebot Wiki 2 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Bebot Wiki 2:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)