FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » ircbot with NickServ and IRCS support.
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Return to the default flat view Create a new topic Submit Reply
Re: ircbot with NickServ and IRCS support. [message #168699 is a reply to message #168687] Fri, 28 June 2013 14:25 Go to previous messageGo to previous message
Argure is currently offline  Argure   Netherlands
Messages: 4
Registered: June 2013
Location: Leiden
Karma:
Junior Member
add to buddy list
ignore all messages by this user

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 14:26]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: shoutbox
Next Topic: Help on -- Advertisement banners ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 07 06:16:07 EST 2024

Total time taken to generate the page: 0.07702 seconds