2012-11-15 01:34:24 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once(__DIR__ . '/lib/imgurbot.php');
|
|
|
|
|
|
|
|
$conf = json_decode(implode("\n", file(__DIR__ . '/conf/settings.conf')));
|
|
|
|
|
|
|
|
$bot = &new ImgurBot($conf);
|
|
|
|
$irc = &new Net_SmartIRC();
|
|
|
|
if($conf->debug) $irc->setDebug(SMARTIRC_DEBUG_ALL);
|
2012-11-15 10:48:27 -05:00
|
|
|
$irc->registerTimehandler($conf->timing, $bot, 'randomTop');
|
2012-11-15 01:34:24 -05:00
|
|
|
if($conf->ssl) {
|
|
|
|
$irc->setUseSockets(FALSE);
|
|
|
|
$irc->connect('ssl://' . $conf->server, $conf->port);
|
|
|
|
} else {
|
|
|
|
$irc->setUseSockets(TRUE);
|
|
|
|
$irc->connect($conf->server, $conf->port);
|
|
|
|
}
|
|
|
|
|
2012-11-15 18:55:19 -05:00
|
|
|
$irc->registerActionhandler(SMARTIRC_TYPE_NICKCHANGE, '', $bot, 'nickFinder');
|
2012-11-15 19:25:44 -05:00
|
|
|
$irc->registerActionhandler(SMARTIRC_TYPE_JOIN, '', $bot, 'nickFinder');
|
2012-11-15 18:55:19 -05:00
|
|
|
|
2012-11-15 01:34:24 -05:00
|
|
|
$irc->login($conf->nick, 'ImgurBot', 0, $conf->nick);
|
2012-11-16 09:21:36 -05:00
|
|
|
$irc->join(array($conf->channel));
|
2012-11-15 01:34:24 -05:00
|
|
|
$irc->listen();
|
|
|
|
$irc->disconnect();
|