<?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/20004" />

	<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>2015-06-29T07:53:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Avalanchee]]></name></author>
		<updated>2015-06-29T07:53:01-04:00</updated>

		<published>2015-06-29T07:53:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104271#p104271</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104271#p104271"/>
		<title type="html"><![CDATA[Communication between scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104271#p104271"><![CDATA[
I must've read tcl-commands.html a dozen times but I guess I missed this event:<br><br><blockquote class="uncited"><div>45. OUT (stackable)<br><br>bind out &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;<br>proc-name &lt;queue&gt; &lt;text&gt; &lt;queued|sent&gt; <br><br>Description: triggered whenever output is sent to the server. Normally the event will occur twice for each line sent: once before entering a server queue and once after the message is actually sent. This allows for more flexible logging of server output and introduces the ability to cancel messages. Mask is matched against "queue status", where status is either 'queued' or 'sent'. Queues are: mode, server, help, noqueue. noqueue is only used by the putnow tcl command.<br><br>Module: server</div></blockquote>I believe this is exactly what I'm looking for.<br>Thanks dude!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12543">Avalanchee</a> — Mon Jun 29, 2015 7:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Avalanchee]]></name></author>
		<updated>2015-06-23T03:44:55-04:00</updated>

		<published>2015-06-23T03:44:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104260#p104260</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104260#p104260"/>
		<title type="html"><![CDATA[Communication between scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104260#p104260"><![CDATA[
Thanks for the answer <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>First of all I'll explain my scenario.<br>I have a bot with multiple scripts that each have their own bind such as: 'bind pubm -|- * MyProc'.<br>In addition, the bot has a "web chat" functionality - meaning users are able to connect via web and see the chat log, as well as write lines.<br>Naturally, as far as the IRC server sees it, those lines are originated from the bot.<br>The bottom line is that I'd like for all the pubm (et al.) binds to trigger for lines that originate from the bot.<br><blockquote class="uncited"><div>Also, check out:<br><a href="http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br>and text search for<br>callevent<br>In some certain situations, it might do what you want. Else, we will see what you specifically have, via the examples you post. </div></blockquote>Yea I found callevent but it appears to be a very specific set of events.<br>My idea was more about triggering a bind.<br>For instance I have a script with a bind:<div class="codebox"><p>Code: </p><pre><code>bind pubm -|- * Main</code></pre></div>and would've liked to "artificially" trigger this pubm event using some special tcl command.<br>For example, it would be cool to be able to tap into the internal eggdrop buffer that receives pubm messages and manually insert a fake event (in this case, a channel message) into the queue.<br><blockquote class="uncited"><div>The bot doesn't 'see' its own posts. </div></blockquote>This is unfortunate.<br>I would've liked to have a specific bind for IRC events (such a pubm or topic) that originate from the bot.<br><blockquote class="uncited"><div>What comes to mind, is instead of having the bot do:<br>putserv "privmsg #chan ...<br>in hopes of triggering the bind, just call the proc right there, that the bind would have called anyway. If you need to have the public post, then simply do both. </div></blockquote>This could get complicated quickly.<br>It means that for each script that has a "putserv privmsg #chan", I need to add proc calls for all the other scripts.<br>i.e. for x scripts there needs to be x^2 proc calls.<br>Nonetheless it seems like this is the only viable option to do this.<br><br>I'd love to hear how would you guys solve this issue.<br>Thanks again.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12543">Avalanchee</a> — Tue Jun 23, 2015 3:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-06-22T12:54:30-04:00</updated>

		<published>2015-06-22T12:54:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104257#p104257</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104257#p104257"/>
		<title type="html"><![CDATA[Re: Communication between scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104257#p104257"><![CDATA[
<blockquote class="uncited"><div>...<br><br>1) Is there a way to invoke a procedure that belongs to script #1 from within script #2?</div></blockquote>Think of a proc as a new command.  <br>Just use it the same as you would any other command.   (assuming when you call it, you are in the same namespace - I see that you have discovered them )<br><br><blockquote class="uncited"><div>2) Is there a way to trigger a bind manually? I mean script #1 binds the proc to a specific event, which script #2 will trigger using some TCL command.</div></blockquote>Can you elaborate more?   Give an example if you can.<br><br>Also,  check out:<br><a href="http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br>and text search for <br>callevent<br>In some certain situations, it might do what you want.   Else, we will see what you specifically have, via the examples you post.<br><blockquote class="uncited"><div>3) Relates to question #2 - Is there a way to make the bot trigger events on their own IRC commands? For instance, if I bind something to pubm on #chan - can the bot somehow trigger that event when it performs PRIVMSG #chan text?</div></blockquote>The bot doesn't 'see' its own posts.   <br><br>Here can be found a way to make it log its own posts:<br><a href="http://thommey.tclhelp.net/?page=scripts" class="postlink">http://thommey.tclhelp.net/?page=scripts</a><br><br>But - again, how about some example or more description of what you are really wanting to do?   <br>What comes to mind, is instead of having the bot do:<br>putserv "privmsg #chan ...<br>in hopes of triggering the bind,  just call the proc right there, that the bind would have called anyway.     If you need to have the public post,  then simply do both.  <br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Jun 22, 2015 12:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Avalanchee]]></name></author>
		<updated>2015-06-22T08:54:14-04:00</updated>

		<published>2015-06-22T08:54:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104256#p104256</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104256#p104256"/>
		<title type="html"><![CDATA[Communication between scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104256#p104256"><![CDATA[
Hello,<br>I would like to know what is the best way to reuse code between different scripts?<br><br>I'll split my post into multiple questions:<br><br>1) Is there a way to invoke a procedure that belongs to script #1 from within script #2?<br>I know about the "source" command, but I don't think it's healthy to invoke the same script multiple times. script #1 contains binds and one-time inits which I don't want to run more than once.<br><br>2) Is there a way to trigger a bind manually? I mean script #1 binds the proc to a specific event, which script #2 will trigger using some TCL command.<br><br>3) Relates to question #2 - Is there a way to make the bot trigger events on their own IRC commands? For instance, if I bind something to pubm on #chan - can the bot somehow trigger that event when it performs PRIVMSG #chan text?<br><br>Thank you for your help.<br><br>[EDIT: I was able to solve 1) using namespaces. Would still like to hear opinions regarding 2) and 3)]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12543">Avalanchee</a> — Mon Jun 22, 2015 8:54 am</p><hr />
]]></content>
	</entry>
	</feed>
