Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- V1: http://pastebin.com/iEx02e3h
- Place this code in the functions list of the script
- */
- function getXatConnections($roomID) {
- $apiUsername = 'USERNAME_HERE';
- $apiToken = 'API_TOKEN_HERE';
- $res = file_get_contents('https://arcbots.com/api-v2.html&tools=chatip&user='.$apiUsername.'&apiToken='.$apiToken.'&chatroom='.$roomID);
- $data = json_decode($res,true);
- if($data['errorCode'] == 3) {
- $this->ip = $data['ip'];
- $this->port = $data['port'];
- return true;
- }
- return false;
- }
- /*
- How to use it:
- $bot = new BasicXatBot();
- $roomID = 88973610;
- $bot->getXatConnections($roomID); // <<Place this line of code similarly around here
- $bot->connect($bot->ip,$bot->port); // << Change default IP/Port connections into the scripts $bot-> variables
- $bot->join($roomID);
- while(true){
- if($bot->read()=='DIED') {
- $bot->connect($bot->ip,$bot->port); // << Same as above, with the variables
- $bot->join($roomID);
- }
- }
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement