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

	<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>2006-09-19T22:55:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[matey]]></name></author>
		<updated>2006-09-19T22:55:42-04:00</updated>

		<published>2006-09-19T22:55:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66479#p66479</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66479#p66479"/>
		<title type="html"><![CDATA[variables, globals?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66479#p66479"><![CDATA[
(Sorry for the poor subject, but i couldnt find a better one)<br><br>The following script listens on a socket and sends the result into an IRC channel.<br>It works.<br>I want it to not send identical messages in a row. Therefore I'd like to store the $msg before it is send out to the channel, and check the next time, before a message is sent, if the stored text is identical to $msg.<br>If so, the script should interrupt and wait for the next piece of incoming data.<br><br>My question basically is: What kind of variable do i need to store the message? a global, or var? I tried to set up a simple loop all night long but it just didnt work.<br><br>Here's the code:<br><div class="codebox"><p>Code: </p><pre><code> socket -server blubb 4711proc blubb {cid addr port} { fconfigure $cid -buffering line -blocking 0;fileevent $cid readable "bbb $cid"}proc bbb {cid} {if {[gets $cid msg] == ""} {putserv "PRIVMSG #grill-bill :empty"close $cid; return}putserv "PRIVMSG #grill-bill :$msg" close $cid; return}</code></pre></div>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8211">matey</a> — Tue Sep 19, 2006 10:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
