Example #1
0
File: bot.php Project: numb95/pmg
 // NickServ
 if (Config::$nickservPassword) {
     $server->identifyWithNickServ();
 }
 // Loop through the channels in the config and join them
 foreach (Config::$channels as $channel) {
     $server->join($channel);
 }
 // Loop-edy-loop
 $cntUpd = 0;
 while ($server->connected()) {
     $line = $server->getNextLine();
     $line = new ReceivedLine($line);
     $line->parse();
     if ($line->isCommand()) {
         $command = new Command($line);
         $command->execute();
     }
     if ($line->isMappedEvent()) {
         $event = new Event($line);
         $event->execute();
     }
     if ($line->isMappedTrigger()) {
         $trigger = new Trigger($line);
         $trigger->execute();
     }
     $cntUpd++;
     if ($cntUpd > 1000) {
         $db->updateDatabase();
         $cntUpd = 0;
     }
Example #2
0
     $server->identifyWithNickServ();
 }
 // Connect commands
 ModuleManager::runConnectCommands();
 // Loop through the channels in the config and join them
 $channels = Config::getValue("channels");
 foreach ($channels as $channel) {
     $server->join($channel);
 }
 // Loop-edy-loop
 while ($server->connected()) {
     $line = $server->getNextLine();
     $line = new ReceivedLine($line);
     $line->parse();
     if ($line->isMappedCommand()) {
         $command = new Command($line);
         $command->execute();
     }
     if ($line->isMappedEvent()) {
         $event = new Event($line);
         $event->execute();
     }
     if ($line->isMappedTrigger()) {
         $trigger = new Trigger($line);
         $trigger->execute();
     }
     if (time() - 2 >= $lastUpdate) {
         $db->updateScriptArrays();
         $db->updateDatabase();
         $lastUpdate = time();
     }