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

	<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-11-28T14:16:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2006-11-28T14:16:12-04:00</updated>

		<published>2006-11-28T14:16:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68551#p68551</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68551#p68551"/>
		<title type="html"><![CDATA[booleans with TCL?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68551#p68551"><![CDATA[
First of all, tcl does'nt compile..<br>As for the proc command, it only cares that it is given three arguments ("name", "header", and "body", where header is a list of arguments for the created proc and body it's contents). No parsing or checking other than the normal expansions is performed.<br><br>To find out wether there's any syntactical error within your proc, you'll have to make sure that part of the proc is executed once the proc itself has been defined.<br><br>Also, the idea behind your code is flawed. It seems you assume the whole script will be run every time you issue a command; that is not true. The script will only be evaluated when it's loaded with "script path/to/file". You'll have to check the value of your "var" inside any proc that uses it as a conditional, trying to put proc definitions within such a conditional would only affect wether that proc is (re)defined when the script is evaluated (usually only when your bot is (re)started or rehashed).<br><br>You probably want something like this:<div class="codebox"><p>Code: </p><pre><code>set cond truebind msgm - * myprocproc myproc {nick host hand text} { global cond if {$cond} {  puthelp "PRIVMSG $nick :Message sent"  ... }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Nov 28, 2006 2:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[reddy]]></name></author>
		<updated>2006-11-28T13:54:09-04:00</updated>

		<published>2006-11-28T13:54:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68549#p68549</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68549#p68549"/>
		<title type="html"><![CDATA[booleans with TCL?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68549#p68549"><![CDATA[
This compiles, but it doesnt work. can anyone help? please?<br><blockquote class="uncited"><div>global var<br>set var TRUE<br><br>bind pub - !start pub_start<br>proc pub_start {nick host hand chan lang text} {<br>global var<br>set var TRUE<br>putserv "PRIVMSG #channel : FORWARD TURNED ON"<br>}<br><br>bind pub - !stop pub_stop<br>proc pub_stop {nick host hand chan lang text} {<br>global var<br>set var FALSE<br>putserv "PRIVMSG #channel : FORWARD TURNED OFF"<br>}<br><br><br>#########################<br><br>if {$var} {<br>bind msgm - "*" proc:laina<br>set chan "#channel"<br>proc proc:laina {nick uhost hand arg} {<br>global chan<br>set line [string trim $arg]<br>if {$nick == "SeenServ"} {<br>puthelp "privmsg $chan :SeenServ returned: $line"<br>return 0<br>}<br>puthelp "PRIVMSG $chan :\0034 \002$nick : $line\002   ::\0032 /msg $nick"<br>puthelp "PRIVMSG $nick :hey, Im the manager bot! Yourmessage is logged, a member may, or may not contact you with a reply to your query. Thanks!"<br>}<br>}<br><br>if {!$var} {<br>putserv "PRIVMSG #channel : GO AWAY!"<br>}</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8428">reddy</a> — Tue Nov 28, 2006 1:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[reddy]]></name></author>
		<updated>2006-11-28T10:35:09-04:00</updated>

		<published>2006-11-28T10:35:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68546#p68546</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68546#p68546"/>
		<title type="html"><![CDATA[booleans with TCL?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68546#p68546"><![CDATA[
i have a message forwarding script, so when someone pm's my bot it does xxx. Im getting other bots pming my bot and spamming crap into my selected channel to which the private messages get sent <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><br><br>How can i use booleans with TCL?<br><br>As in <br><br>Declare Forward as a variable. <br><br>if (forward == true) send stuff to my channel<br>if (forward == false) dont send stuff to my channel? <br><br>Heres the code that needs to contain the trigger for the bool<br><blockquote class="uncited"><div>bind pub - !dothis pub_dothis<br>proc pub_dothis {nick host hand chan lang text} {<br>    <strong class="text-strong">SET BOOLEAN TO TRUE</strong><br>    putserv "PRIVMSG #mychannel : say something lalalalal"<br>}</div></blockquote><br>heres the forward script, how can i convert this to switch on and off? <br><br>I run <br><blockquote class="uncited"><div>bind msgm - "*" proc:laina<br><br>set chan "#myprivatechannel"<br>proc proc:laina {nick uhost hand arg} {<br>global chan<br>set line [string trim $arg]<br>if {$nick == "SeenServ"} {<br>puthelp "privmsg $chan :SeenServ returned: $line"<br>return 0<br>}<br><br>puthelp "PRIVMSG $chan :\0034 \002$nick : $line\002   ::\0032 /msg $nick"<br>puthelp "PRIVMSG $nick : Your message is logged, ill get back to you in a minute" <br>}<br>return 0<br></div></blockquote>My ultimate goal would be to have both of those scripts contained within the same TCL file, can anyone help?<br><br>Cheers! <br><br>reddy<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8428">reddy</a> — Tue Nov 28, 2006 10:35 am</p><hr />
]]></content>
	</entry>
	</feed>
