$botzilla->addZiggis(array(array('reg.class.php', array('access' => BZUSER_ANYONE)), array('operator.class.php', array('access' => BZUSER_OWNER)))); // start the bot! while ($botzilla->reconnect) { // connect to network if (!$botzilla->connect()) { exit; } // a message should have already printed // join specified channels if (is_array($channels)) { foreach ($channels as $c) { $botzilla->join($c, TRUE); } } // identify with nickserv (change name as needed). if ($nick_passwd) { $botzilla->pm("identify {$nick_passwd}", 'nickserv'); } // this loop continues as long as the bot is connected. $botzilla->listen(); // being here means that we've lost our connection // did we say QUIT ? if (!$botzilla->reconnect) { echo "Exiting\n"; exit; } // the bot will reconnect if we didn't. echo "brb, restarting..\n"; unset($botzilla->connection); sleep(10); }