- #!/usr/bin/php -q
- <?php
- // Stop the bot halting
- set_time_limit(0);
- $fp = fsockopen('ip', port);
- if ($fp) {
- fputs($fp, "PASS :serverpass\n");
- fputs($fp, "AuthServ :AUTH websiteaccount websitepass\n");
- $db = mysql_connect('localhost', 'user', 'pass');
- mysql_select_db('irc', $db);
- while (!feof($fp)) {
- $buffer = trim(fgets($fp, 4096));
- $tokens = explode(" ", $buffer);
- // commands here
- }
- }
- ?>
