public function expiredCommands() { foreach ($this->commandQueue as $key => $command) { if (time() >= $command['ExecuteTime']) { //Execute it. bawkBotExecuteCommand($command['Server'], $command['Nick'], "PRIVMSG", $command['Channel'], $command['Command'], "", true); //Since it's expired, lets remove it. unset($this->commandQueue[$key]); } } }
//Fixes the syntax if BawkBot receives a private message. if (substr($messageChan, 0, 1) != "#") { $messageChan = $messageNick; } /* $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { pcntl_wait($status); } else { */ //Try to execute the command. print_r($messageChan); bawkBotExecuteCommand($server, $messageNick, $messageType, $messageChan, $messageCont, $messageMask); /* posix_kill(getmypid(),9); }*/ } //if (ping) } //if feof } //foreach serverThread usleep(5000); } while (true); /*Bawkbot Parser & Commander, the bread and butter of the bot.*/ function bawkBotExecuteCommand($server, $messageNick, $messageType, $messageChan, $messageCont, $messageMask = "", $choke = false) { global $plugins, $aliaser, $messageQueue, $mysql_statistics, $mysql_statistics;