<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/16659" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-09-12T03:15:50-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/16659</id>

		<entry>
		<author><name><![CDATA[unavailable]]></name></author>
		<updated>2009-09-12T03:15:50-04:00</updated>

		<published>2009-09-12T03:15:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90225#p90225</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90225#p90225"/>
		<title type="html"><![CDATA[IP.Board New Thread Notification (v1.0)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90225#p90225"><![CDATA[
What about a version to phpBB?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10856">unavailable</a> — Sat Sep 12, 2009 3:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arejay]]></name></author>
		<updated>2009-08-30T02:02:52-04:00</updated>

		<published>2009-08-30T02:02:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90095#p90095</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90095#p90095"/>
		<title type="html"><![CDATA[IP.Board New Thread Notification (v1.0)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90095#p90095"><![CDATA[
I cannot get this working, i turned on debug (set it to true)<br><br>and get this:<br><div class="codebox"><p>Code: </p><pre><code>$ircMessage: New thread posted by arejay in Off-Topic&lt;br /&gt;test (http://theiphonebay.com/forums/index.php?showtopic=426)IRC Channel: #chatIRC Server IP: cube.dawnshosting.comIRC Server Port: 13481Checking valid forums...Forum array count: 0$ircMessage after replaces: New thread posted by arejay in Off-Topic;test (http://theiphonebay.com/forums/index.php?showtopic=426)$line: #chat New thread posted by arejay in Off-Topic;test (http://theiphonebay.com/forums/index.php?showtopic=426)Got a valid socket. Sending and waiting...Done sending. Closing socket</code></pre></div><br>and in bot during telnet<br><div class="codebox"><p>Code: </p><pre><code>02:00] net: connect! sock 8[02:00] DNS resolved 69.42.210.218 to dc-node.bytebistro.com[02:00] Telnet connection: dc-node.bytebistro.com/43135[02:00] net: eof!(read) socket 13[02:00] Lost connection while identing [dc-node.bytebistro.com/43135]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9885">arejay</a> — Sun Aug 30, 2009 2:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Apoc]]></name></author>
		<updated>2009-02-25T22:33:41-04:00</updated>

		<published>2009-02-25T22:33:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87565#p87565</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87565#p87565"/>
		<title type="html"><![CDATA[IP.Board New Thread Notification (v1.0)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87565#p87565"><![CDATA[
First of all, credits to ShavdApe (<a href="http://forum.egghelp.org/viewtopic.php?p=31532#31532" class="postlink">this post</a>) for the main TCL code, and the idea.<br><br>I ported it to IP.Board 2.3.6 (may work on older versions, just edit the message line in the code below)<br><br>ipbnewthread.tcl<div class="codebox"><p>Code: </p><pre><code># IPB New Thread TCL# Original by ShavdApe (http://forum.egghelp.org/viewtopic.php?p=31532#31532)# Modified by Apoc for some simple names, and formatting differences. (In case you run vBulletin as well :P)# Date: 2/25/2009# Version: 1.0## Description: Just a simple socket listener to execute an IRC command# from the PHP script run by an IP.Board installation.# If you change this port here, you'll need to change it in class_irc_send.php too!listen 13481 script ipbnewthreadacceptproc ipbnewthreadaccept {idx} {control $idx ipbincoming}proc ipbincoming {idx args} {putlog "$args"set line [join $args]if {[join $args] != "" } {set chan [lindex $line 0]set line [lrange $line 1 end]set line [join $line]set line [split $line ";"]foreach line $line { putserv "PRIVMSG $chan :$line" }putlog "$line"}killdcc $idx}putlog "IPB New Thread Notifications Loaded..."</code></pre></div>class_irc_send.php (put this in sources/classes/post/ of your IPB installation)<div class="codebox"><p>Code: </p><pre><code>&lt;?php/*irc_send class by Apoc (2/25/2009) v1.0What: A simple class to send out a verified message to an eggdrop IRC bot.How: Options are set via ACP, and sent via a single socket open/write.When: Whenever you want to call it! :)Usage: $irc-&gt;send(&lt;forum id&gt;, &lt;message to send&gt;);Yep, it's that simple.Credits: ShavdApe (http://forum.egghelp.org/viewtopic.php?p=31532#31532)Apoc - Created this as a class for IP.Board, and made it easier in general to use.*/class irc_send{// Add any allowed forumids here. These will be checked each time you// have a new thread created. (This is useful if you don't want certain// forums to show a message in IRC. Eg; staff forums)// Leave this empty to allow all forums.var $allowed_forums = array();// Set this to the channel you want to output to in IRC.var $irc_channel = '#yourchannel';// Put the IP of your bot here.// If your bot is running locally, you can usually just// set this to localhost.var $irc_server_ip = "your.bots.ip.here";// Do not change this unless you have changed it in the TCL file as well!!!var $irc_server_port = "13481";// If you want this class to enable some debug messages. (Logged to this current folder path/irc_debug.txt)// set this to true. Otherwise leave it off.// It is highly suggested you leave this off once you have everything working!var $_enable_debug = false;//----------------------------------// Main IRC Sending method.// Args:// @forumId: The forumId of the message being sent.// @ircMessage: The actual message to send. This must be pre-formatted. (Excluding &lt;br /&gt; tags, and ; characters.)// Returns: Nothing//----------------------------------function send($forumId, $ircMessage){$this-&gt;write_debug("\$ircMessage: ".$ircMessage);// Make sure we have some valid text passed to us.if (!$ircMessage){return;}$this-&gt;write_debug("IRC Channel: ".$this-&gt;irc_channel);$this-&gt;write_debug("IRC Server IP: ".$this-&gt;irc_server_ip);$this-&gt;write_debug("IRC Server Port: ".$this-&gt;irc_server_port);// Sanity checks!if (!$this-&gt;irc_channel || !$this-&gt;irc_server_ip || !$this-&gt;irc_server_port){return;}$this-&gt;write_debug("Checking valid forums...");// Make sure the forum is valid to be passed to IRC.// This makes sure that if our allowed_forums array has any forums in it,// that the $forumId var is in that array.if (!$this-&gt;valid_forum($forumId)){return;}// Do some IRC splitting and replacing.$ircMessage = ereg_replace(";", ":", $ircMessage);$ircMessage = ereg_replace("&lt;br /&gt;", ";", $ircMessage);$this-&gt;write_debug("\$ircMessage after replaces: ".$ircMessage);$line = "{$this-&gt;irc_channel} {$ircMessage}";$this-&gt;write_debug("\$line: ".$line);// open socket and put the line$socket = @fsockopen ($this-&gt;irc_server_ip, $this-&gt;irc_server_port, $null, $null, 30);if ($socket){$this-&gt;write_debug("Got a valid socket. Sending and waiting...");@fwrite($socket,"{$line}\n");for($i=0;$i&lt;400000;$i++){$g=$i;} $this-&gt;write_debug("Done sending. Closing socket");fclose($socket);}else{$this-&gt;write_debug("FAILED TO OPEN SOCKET!!!");}}private function valid_forum($id){$this-&gt;write_debug("Forum array count: ". count($this-&gt;allowed_forums));// If we have 0 forums in the array,// all forums should be passed. And are therefore, valid.if (count($this-&gt;allowed_forums) == 0){return true;}$this-&gt;write_debug("Id in forum: ($id) - ". in_array($this-&gt;allowed_forums));// Just return whether the id is in the allowed forums array.return in_array($id, $this-&gt;allowed_forums);}private function write_debug($m){if (!$this-&gt;_enable_debug){return;}$f = ROOT_PATH.'sources/classes/post/irc_debug.txt';$h = fopen($f, 'a');fwrite($h, $m."\n");fclose($h);}}?&gt;</code></pre></div>Edits for class_post_new.php (In sources/classes/post)<div class="codebox"><p>Code: </p><pre><code>Find://-----------------------------------------// Redirect them back to the topic//-----------------------------------------Add above://-----------------------------------------// Send out our IRC message//-----------------------------------------require_once(ROOT_PATH.'sources/classes/post/class_irc_send.php');$irc = new irc_send();$line = "New thread posted by {$this-&gt;topic['starter_name']} in {$this-&gt;forum['name']}&lt;br /&gt;";$line .= $this-&gt;topic['title'] . ' (' . $this-&gt;ipsclass-&gt;base_url . "showtopic=" . $this-&gt;topic['tid'] . ')';$irc-&gt;send($this-&gt;forum['id'], $line);</code></pre></div>Save and upload.<br><br>Finally, edit the code in class_irc_send.php to the proper values for your bot. (See the comments for proper values)<br><br>Note: If you change the message in the class_new_post.php that gets sent to IRC, make sure you use either '&lt;br /&gt;' or '\n' to separate lines. (Reason for XHTML compliant &lt;br /&gt; is that I was going to add ACP configuration at some point. But was just too lazy to do it. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<br><br>Enjoy, and please leave comments/feedback![/url]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10519">Apoc</a> — Wed Feb 25, 2009 10:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
