/** * This function creates a bot with the specified name and network, and * optionally joins a number of channels. * * @param string $sName Nickname of the bot to create. * @param string $sNetwork Name of the network to connect with. * @param array $aChannels Array of channels to auto-join. */ public function create($sName, $sNetwork, $aChannels = array()) { $pBot = new Bot($sName); $pBot->setNetwork($sNetwork); $pBot->connect(); foreach ((array) $aChannels as $sChannel) { $pBot->send('JOIN ' . $sChannel); } }
<?php //error_reporting(0); @set_time_limit(0); //@ini_set ('max_execution_time', "0"); include "classes/bot.php"; include "XMPPHP/XMPP.php"; include "classes/Module.php"; include "classes/mysql.php"; include "classes/Misc.php"; global $bot; $bot = new Bot(new SimpleXMLElement(file_get_contents("config.xml"))); $bot->loadModules(); $bot->connect(); $bot->workCycle();