Example #1
0
Because the default is to send return messages back to "where the requeswt came from", we declare a channel/nick here.
The alarm plugin is better if you want repeating events at an absolute time.
*/
// load ziggi plugins
$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.