ircbot.ini introduces new variables:
'IRCBOT_USESSL' => '',
'IRCBOT_GECOS' => '',
'IRCBOT_USENICKSERV' => '',
'IRCBOT_NICKSERVPASS' => '',
%dataroot%/plugins/ircbot.plugin:
89:97
<p>IRC server hostname:<br />
<input name="IRCBOT_HOST" value="<?php echo $ini['IRCBOT_HOST'] ?>" size="50" /></p>
<p>Use SSL to connect to the IRC server?<br />
<label><input type="radio" name="IRCBOT_USESSL" value="1" <?php echo $ini['IRCBOT_USESSL'] ? 'checked="checked"' : '' ?> /> True<br /></label>
<label><input type="radio" name="IRCBOT_USESSL" value="" <?php echo $ini['IRCBOT_USESSL'] ? '' : 'checked="checked"' ?> /> False</label></p>
<p>IRC port (normally 6667, or 6697 when using SSL):<br />
<input name="IRCBOT_PORT" value="<?php echo intval($ini['IRCBOT_PORT']) ?>" size="5" /></p>
105:113
<p>Bot's gecos (real name):<br />
<input name="IRCBOT_GECOS" value="<?php echo $ini['IRCBOT_GECOS'] ?>" size="20" /></p>
<p>Identify with NickServ?<br />
<label><input type="radio" name="IRCBOT_USENICKSERV" value="1" <?php echo $ini['IRCBOT_USENICKSERV'] ? 'checked="checked"' : '' ?> /> True<br /></label>
<label><input type="radio" name="IRCBOT_USENICKSERV" value="" <?php echo $ini['IRCBOT_USENICKSERV'] ? '' : 'checked="checked"' ?> /> False</label></p>
<p>NickServ password:<br />
<input name="IRCBOT_NICKSERVPASS" value="<?php echo $ini['IRCBOT_NICKSERVPASS'] ?>" size="20" /></p>
%dataroot%/scripts/ircbot.php
103:107
if ($ini['IRCBOT_USESSL']) {
$server['SOCKET'] = fsockopen('ssl://' . $ini['IRCBOT_HOST'], $ini['IRCBOT_PORT'], $errno, $errstr, 2);
} else {
$server['SOCKET'] = fsockopen($ini['IRCBOT_HOST'], $ini['IRCBOT_PORT'], $errno, $errstr, 2);
}
112:120
// Login, authenticate and join channel.
if (!empty($ini['IRCBOT_NICK'])) {
send_command('PASS NOPASS');
send_command('NICK '. $ini['IRCBOT_NICK']);
send_command('USER '. $ini['IRCBOT_NICK'] .' '. $ini['IRCBOT_HOST'] .' bla :'. $ini['IRCBOT_GECOS']);
}
if ($ini['IRCBOT_USENICKSERV']) {
send_command('PRIVMSG NickServ :IDENTIFY '. $ini['IRCBOT_NICK'] .' '. $ini['IRCBOT_NICKSERVPASS']);
}
I'll probably some day(tm) implement having the bot be able to set modes (e.g., +B) and have it support SASL authentication, optionally with TLS_EXTERNAL.
[Updated on: Fri, 28 June 2013 18:26]
Report message to a moderator