Example #1
0
$irc->setDebug(SMARTIRC_DEBUG_NONE);
//$irc->setUseSockets(true);
$irc->setChannelSyncing(true);
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^exit\\s/', $bot, "msgExit");
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^info$/', $bot, "msgInfo");
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^tipcreate$/', $bot, "msgTipcreate");
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^withdraw\\s/', $bot, "msgWithdraw");
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^getvip\\s/', $bot, "msgGetvip");
$irc->registerActionHandler(SMARTIRC_TYPE_QUERY, '/^getad\\s/', $bot, "msgGetad");
$irc->registerActionHandler(SMARTIRC_TYPE_CHANNEL, '/!/', $bot, "chanMsg");
$irc->registerActionHandler(SMARTIRC_TYPE_ACTION, '/!/', $bot, "chanMsg");
$irc->registerActionHandler(SMARTIRC_TYPE_JOIN, '/\\#dogec0in$/', $bot, "onJoin");
$irc->registerActionHandler(SMARTIRC_TYPE_NICKCHANGE, '.*', $bot, "onNickChange");
while (1) {
    $irc->connect("localhost", 7000, true);
    $irc->login("wowsuchtips", "much tipping", 8, "manydoge", '');
    $irc->send("oper username password");
    // oline
    $irc->send("part #services :");
    $irc->message(SMARTIRC_TYPE_QUERY, "nickserv", "identify password");
    $irc->join(array("#dogec0in", "#dogec0in-vip", "#dogec0in-gamble", "#dogec0in-tip", "#dogec0in-trade"));
    $irc->send("samode #dogec0in +Y wowsuchtips");
    $irc->send("samode #dogec0in-vip +Y wowsuchtips");
    $irc->send("samode #dogec0in-tip +Y wowsuchtips");
    $irc->send("samode #dogec0in-gamble +Y wowsuchtips");
    $irc->send("samode #dogec0in-trade +Y wowsuchtips");
    $irc->setModulepath(".");
    $irc->loadModule("PingFix");
    $irc->listen();
    $irc->disconnect();
}