BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: Exodus00FF on May 12, 2010, 09:53:27 pm
-
In the last few months I began developing a module which is activated by cron, which uploads a list of active online users to a website rpc server. This is not complete code, but it is the begging of a new project.
Attached to this post are 4 Files.
To begin installation you have to start with the rpc_server.zip file.
- Begin by unzipping it to your where you host your php based website.
- I recommend placing the contents in a sub-folder named like xmlrpc.
- Run the install.sql against your MySQL Database.
- Set the Following Variables in your server.php file.
- $dbserver
- $db
- $dbuser
- $dbpassword
Now you should be able to Start Testing it.
- Unzip the rpc_testclient.zip somewhere and make Change the following 2 Variables.
- $site = "Domain of where you have server.php installed"
- $location = "Absolute Path to where you have server.php installed including the leading slash"
If everthing works fine it you can move on to loading the Bebot Module
- Just copy ActiveUsers.php to your modules/aoc directory.
- Restart the Bot
- Change the Site and Locations Settings
Now the bot should be uploading to the RPC server every 300 seconds.
Now the tricky part for those of you who don't use joomla. I'm providing the fourth part as a joomla mod. For any of you who are coders you shouldn't have any issues converting this into a module that will work with your website, others might have more problems if they don't know php, html, or sql.
Feel free to modify the code, and repost it here, and I'll update this post as modifications occur. Bear in mind this is an unfinished project.
-
For a simple Namelisting to be used in e.g. Burning Board just create a new PHP-Box,
copy this code and enter your user variables. Or copy this Code into whatever you are using.
<?
$hostname = "localhost";
$username = "username";
$password = "password";
$dbname = "yourDB";
mysql_pconnect ($hostname,$username,$password) or DIE ("not Connected");
mysql_select_db ($dbname) or DIE ("Database not found");
$query = "select * from bebot_users where is_online=1";
$result = mysql_query($query) or die ("Query died! Poor Query");
while ( $row = mysql_fetch_row ( $result ) )
{
echo $row[1] . '<br>';
}
?>
-
I would love to have a way to access this list from guildlaunch.
-
Streak That only works if your Bot and Website are hosted on the Same Box or have access to the same database. This is for when your setup has your Bot on a VPS (Virtual Private Server) or local machine b/c your ISP does not allow you to use IRC Bots.
-
For a simple Namelisting to be used in e.g. Burning Board just create a new PHP-Box,
copy this code and enter your user variables. Or copy this Code into whatever you are using.
<?
$hostname = "localhost";
$username = "username";
$password = "password";
$dbname = "yourDB";
mysql_pconnect ($hostname,$username,$password) or DIE ("not Connected");
mysql_select_db ($dbname) or DIE ("Database not found");
$query = "select * from bebot_users where is_online=1";
$result = mysql_query($query) or die ("Query died! Poor Query");
while ( $row = mysql_fetch_row ( $result ) )
{
echo $row[1] . '<br>';
}
?>
Hi can you put rank on it? (Member,Officer,Guild Leader)
-
Streak That only works if your Bot and Website are hosted on the Same Box or have access to the same database. This is for when your setup has your Bot on a VPS (Virtual Private Server) or local machine b/c your ISP does not allow you to use IRC Bots.
Well, if your of a mind to, you can open a port on your local bot machine (where database is) and connect/query it from the php/web server for live query when the page is hit. Your host connection just needs to include IP and port ...
$hostname = 'xxx.xxx.xxx.xxx:3306'
-
Streak That only works if your Bot and Website are hosted on the Same Box or have access to the same database. This is for when your setup has your Bot on a VPS (Virtual Private Server) or local machine b/c your ISP does not allow you to use IRC Bots.
Well, if your of a mind to, you can open a port on your local bot machine (where database is) and connect/query it from the php/web server for live query when the page is hit. Your host connection just needs to include IP and port ...
$hostname = 'xxx.xxx.xxx.xxx:3306'
Perfect! I'll test it as soon as I can.
-
i forgott:
with the code from Streak:
there is a problem, when the bot is not online,
the forum is not reachable.
can anyone fix this problem?
thx
-
kk just some questions ;)
i tried to test this but there must be a mistake between my two ears ;)
here my configs
1.
/* Define variables to find the rpc server script */
$site = "http://gilde-obsidiancult.de/";
$location = "/srv/www/vhosts/gilde-obsidiancult.de/httpdocs/testumgebung/server.php";
all the files are in one directory ... called testumgebung the link would be http://gilde-osbsidiancult.de/testumgebung
i use joomla
when u look at http://gilde-obsidiancult.de there u will see the mod on the left side but no active user -.-
the bot should be configured correctly ... so i hope ;)
here the log when u look at tes_client
Names
array(1) {
[0]=>
array(2) {
[0]=>
string(14) "XMLRPC_request"
[1]=>
string(1808) "
Received the following parameter list to send:
Array
(
[0] => Array
(
[array] => Array
(
[data] => Array
(
[value] => Array
(
[0] => Array
(
[string] => Name1
)
[1] => Array
(
[string] => Name2
)
[2] => Array
(
[string] => Name3
)
[3] => Array
(
[string] => Name4
)
[4] => Array
(
[string] => Name5
)
[5] => Array
(
[string] => Name6
)
[6] => Array
(
[string] => Name7
)
)
)
)
)
)
"
}
}
Success
bool(false)
Response
array(2) {
["faultCode"]=>
int(10532)
["faultString"]=>
string(56) "Connection failed: Couldn't make the connection to http."
}
kk don't know where is the mistake ...
maybee the db is the reason ... couse we don't use bebot_users ... we use for example cultmeister_users and instead of alts we use just alts don't know if this would be case a confligt of ur mod ...
help would be nice ...
greetz drizz
-
I get this aswell
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in "directory"\kd_xmlrpc.php on line 382
Warning: fsockopen() [function.fsockopen]: unable to connect to http:80 (php_network_getaddresses: getaddrinfo failed: No such host is known. ) in "directory"\xmlrpc\kd_xmlrpc.php on line 382
EDIT:
nvm.. i removed http:// in $site and it worked..
-
i removed http:// in $site and it worked..
doesn't work by me ...
-
Can't get this running as well...
See my test-client here: http://2010.newrising.org/bebotmodul/test-client.php
The bot itself is running on my HD and working as intended, but if I copy the ActiveUsers.php in the modules directory and want to get the mod running, I get an error in the bot:
Warning: fsockopen(): php_network_getadresses: getaddrinfo failed: Der angegebene Host ist unbekannt. in C:\Users\MyUsername\Desktop\BeBot_Folder\modules\aoc\ActiveUsers.php on line 549
Warning: fsockopen(): unable to connect to http:80 (php_network_getadresses: getaddrinfo failed: Der angegebene Host ist unbekannt. ) in C:\Users\MyUsername\Desktop\BeBot_Folder\modules\aoc\ActiveUsers.php on line 549
Any ideas about a solution?
Regards
-
Warning: fsockopen(): php_network_getadresses: getaddrinfo failed: Der angegebene Host ist unbekannt. in C:\Users\MyUsername\Desktop\BeBot_Folder\modules\aoc\ActiveUsers.php on line 549
Warning: fsockopen(): unable to connect to http:80 (php_network_getadresses: getaddrinfo failed: Der angegebene Host ist unbekannt. ) in C:\Users\MyUsername\Desktop\BeBot_Folder\modules\aoc\ActiveUsers.php on line 549
The script is reporting that it fails to lookup the server address given. And for some reason it has been told to lookup http:80 which obviously is not a valid address.
From a brief glance at the script, check your settings for domain and location for the activeuser module.
-
$this -> bot -> core("settings") -> create("activeusers", "domain", "http://2010.newrising.org", "Domain to which the RPC Call will be made");
$this -> bot -> core("settings") -> create("activeusers", "location", "/bebotmodul/server.php", "Absolute Path to server.php");
Looks ok to me, any ideas?
Regards
-
Changing info in the php file will only work if the setting does not exist on the bot.
You need to use the ingame !settings activeusers interface.
-
Allright, did the settings thingy and got same errors. Tried to change http://2010.newrising.org to 2010.newrising.org and at least I don't get any errors in the log atm, seems to be running so far...
Now I might need some assist in thinking, need that working in phpnuke...
Just one thing, will this work if my site CANNOT access the DB of the bot? Cause anyhow I only get bebot running on my locayl drive, tried to run the bot local and use the DB of my homepage but he didn't get any connection so for now Bebot is running local with an apache server and my site is online...
Regards
-
Is the question too nooblike to be worth an answer? OK, let me ask the other way...
Am I right if I think that way:
Bebot scans players and sends result to server.php
server.php writes into DB from webspace (not the bot's DB)
So all input I need is already in the DB of my webspace?
Or am I completely wrong?
Regards
-
Judging from the first post, yes, that is how it works.
The whole point of this mod is that the bot will often run somewhere else than the webserver, and often there is no way for the webserver to access the MySQL server which holds the database including the Online table. So this sets up an RPC server which receives data and saves it into the local database and has the bot setup as a client that sends data.
-
Hehe thx - even if im not that bad in english, sometimes I just miss the clue ^^
Regards