Events

Full BRC - pugFriday
10.09. 20:05
Full BRC - pug

TAS - progress raidSunday
12.09. 18:30
TAS - progress raid

TASTuesday
14.09. 20:05
TAS

TAS - progress raidThursday
16.09. 20:05
TAS - progress raid

Full BRC - pugFriday
17.09. 20:05
Full BRC - pug

TAS - progress raidSunday
19.09. 18:30
TAS - progress raid


ventrilo server Hosting by InstantVentrilo.com
 
Event on Friday, 10.09. 20:05

We are going to Full BRC - pug

You did not apply for event! You can do it HERE!

View module: Whoisingame

<?php
/*
    Who is in game module
    * make upload / post to web site
*/

$whoisingame = new Whoisingame($bot);
/*
    class
*/
class Whoisingame extends BaseActiveModule {
    public 
$bot;
    private 
$authkey;
    
// how much minutes bwtween online check and upload / post
    
private $user_agent =                'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20';
    
// link for where to send characters online
    
private $characters_online_link =    'http://www.yourweb.com/recive_online_chars.php';# your choice
    
private $ping_check =                true;# should web be looked up
    
private $ping_check_link =            'http://www.yourweb.com/ping.php';# your choice on what file to lookup. in file put this adress you type
/*
    class constructior
*/
    
public function __construct(&$bot) {
        
parent::__construct(&$botget_class($this));
        
// settings
        
$this->bot->core('settings')->create('Whoisingame''updatepost''yes''Should it be posted in guild when update is done?''yes;no'false1);
        
$this->bot->core('settings')->create('Whoisingame''updatetime'15'How much time between updates? (needs restart of bot)''5;10;15;30;45;60'false2);

        
// authkey for web
        
$this->authkey sha1('some-text-or-numbers-or-whatever');// i suggest you use this for auth on your web

        
$this->help['description'] = 'Who is online in game and upload / post it on web.';
        
$this->help['notice'] = 'There are no commands for this module!';
        
// register cron event every $this->inverval
        
$i = (int) $this->bot->core('settings')->get('Whoisingame''updatetime');
        
$this->register_event('cron'$i.'minutes');
    }
/*
    command handler (is not needed)
*/
    
public function command_handler($name$msg$origin) {
        return;
    }
/*
    do cron job (upload / post) every $interval minutes
*/
    
public function cron() {
        
// if ping is ok
        
if ($this->ping()) {
            
$data = array(
                
'key' =>                        $this->authkey,
                
'characters' =>                    array()
            );
            
// all characters curently online
            
$data['characters'] = $this->list_users();
            
// there MUST be atleast one user online to send data
            
if (count($data['characters']) > 0) {
                
$data['characters'] = implode(';'$data['characters']);
                
// character data is sent like: char1;char2;char3
                
$data $this->curl_send($this->characters_online_link$data);
                if (
$this->bot->core('settings')->get('Whoisingame''updatepost') == 'yes') {
                    
$this->bot->send_gc('Web update complete.');
                }
            }
            unset(
$data);
        }
        return 
true;
    }
/*
    online user list
*/
    
private function list_users() {
        
$data = array();
        
$online $this -> bot -> db -> select("SELECT t1.nickname FROM #___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc = '1' ORDER BY t1.nickname ASC");
        if (!empty(
$online)) {
            foreach (
$online as $user) {
                
$data[] = $user[0];
                unset(
$user);
            }
        }
        unset(
$online);
        return 
$data;
    }
/*
    ping for web
*/
    
private function ping() {
        
$ok false;
        if (
$this->pink_check) {
            if (
$data = @file_get_contents($this->ping_check_link)) {
                
$data trim($data);
                if (
$data == $this->ping_check_link) {
                    
$ok true;
                }
            }
        }
        else {
            
$ok true;
        }
        return 
$ok;
    }
/*
    send data using curl
    and return something
*/
    
private function curl_send($link$data) {
        if (
$this->ping()) {
            
$cu curl_init();
            
curl_setopt($cuCURLOPT_URL$link);
            
curl_setopt($cuCURLOPT_HEADERtrue);
            
curl_setopt($cuCURLOPT_POSTFIELDS$data);
            
curl_setopt($cuCURLOPT_USERAGENT$this->user_agent);
            
curl_setopt($cuCURLOPT_RETURNTRANSFERtrue);
            
$return_data curl_exec($cu);
            if (
curl_errno($cu)) {$return_data false;}
            
// close cURL
            
else {curl_close($cu);}
            unset(
$cu$link$data);
            return 
$return_data;
        }
        return 
false;
    }
}
?>

Recruitment

AssasinAssasinlow
BarbarianBarbariannone
Bear ShamanBear Shamanmedium
ConquerorConquerornone
Dark TemplarDark Templarlow
DemonologistDemonologistmedium
GuardianGuardiannone
Herald of XotliHerald of Xotlimedium
NecromancerNecromancernone
Priest of MitraPriest of Mitramedium
RangerRangernone
Tempest Of SetTempest Of Setnone

If we are not recruiting it does not mean we are not taking new members. Register on forum and apply at this LINK