/* commands.php */ $core = new core; switch ($command) { case '!test': fputs($socket, "PRIVMSG $chan Working\n"); break; case '!tests': fputs($socket, "PRIVMSG $chan :".$host."\n"); break; case 'still?': fputs($socket, "PRIVMSG $chan Yes\n"); break; case '?admin': if ($core->isadmin($host)) { fputs($socket, "PRIVMSG $chan Yes\n"); } else { fputs($socket, "PRIVMSG $chan No\n"); } break; case '!eval': if (($host == $adminhost1) || ($host == $adminhost2)) { $eval($spoken); } break; } /* core.php (very basic) */ class core { var $command; function say($target, $text) { fputs($socket, "PRIVMSG ".$target." :".$text."\n"); } function isadmin($host) { if (($host == $adminhost1) || ($host == $adminhost2)) { return TRUE; } else { return FALSE; } } } # Both are included in bot.php # the host vars are set in bot.php