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

	<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>2003-08-22T20:12:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2003-08-22T20:12:43-04:00</updated>

		<published>2003-08-22T20:12:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25495#p25495</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25495#p25495"/>
		<title type="html"><![CDATA[Tcl error in script for 'timer209':]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25495#p25495"><![CDATA[
Thank you very much. Modification made and all should be well with the world <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Aug 22, 2003 8:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-22T18:26:12-04:00</updated>

		<published>2003-08-22T18:26:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25484#p25484</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25484#p25484"/>
		<title type="html"><![CDATA[Re: Tcl error in script for 'timer209':]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25484#p25484"><![CDATA[
<blockquote class="uncited"><div>utimer [expr [rand 15] + 5] [greet_do $nick $chan] </div></blockquote>This will execute greet_do immediately and the returned value (usually an empty string) is eval'ed when the timer ends.<br><br>change [greet_do ...] to [list greet_do ...] and everything should be fine<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Aug 22, 2003 6:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2003-08-22T17:45:24-04:00</updated>

		<published>2003-08-22T17:45:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25482#p25482</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25482#p25482"/>
		<title type="html"><![CDATA[Tcl error in script for 'timer209':]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25482#p25482"><![CDATA[
Hi,<br><br>I am testing a rather neat script that does autogreets with a difference, it doesn't greet every Tom, Dick &amp; Harry that enters a channel (a feature I really like). The problem is that it generates the following error (of and on)...<br><br>Tcl error in script for 'timerxxx':<br>invalid command name "1"<br><br>I am unable to contact the author as his e-mail addresses are no longer valid and even a memo on an IRC network proved fruitless.<br><br>Here is the main code:<br><br>bind join - ***** greet_join<br>proc greet_join {nick uhost hand chan} {<br>global botnick publics<br>if {$publics == 0} {return 0}<br><br>if {$botnick == $nick} {return 1}<br>if {![greetchan $chan]} {return 1}<br><br>utimer [expr [rand 15] + 5] [greet_do $nick $chan]<br>return 1<br>}<br><br>proc greet_do {nick chan} {<br> global greet<br> set gnick $nick<br> set anick ""<br> set gloop 0;<br> while {$gloop &lt; [string length $nick]} {<br>  if {[string match "*[string index $nick $gloop]*" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"]} {set anick "$anick[string index $nick $gloop]"}<br>  incr gloop 1<br>                                        }<br> if {[string length $anick] &lt; 3} {set anick $nick}<br># putlog "greet_do $nick $chan anick:$anick gnick:$gnick"<br> if {![onchan $nick $chan]} {return 1}<br> if {![probability $greet(greetprob)]} {return 1}<br> if {![probability $greet(snaprob)]} {set gnick $anick}<br> if {![probability $greet(nlowprob)]} {set gnick [string tolower $gnick]}<br><br> set outmsg [randomline $greet(lines)]<br> if {[probability $greet(mlowprob)]} {set outmsg [string tolower $outmsg]}<br> if {([probability $greet(end1prob)]) &amp;&amp; ([string index $outmsg [expr [string length $outmsg] - 1]] != "?")} {append outmsg [randomline $greet(endings1)]}<br> if {[probability $greet(end2prob)]} {append outmsg [randomline $greet(endings2)]}<br> regsub -all {\$nick} $outmsg $gnick outmsg<br> regsub -all {\$chan} $outmsg $chan outmsg<br> regsub -all {\\001} $outmsg \001 outmsg<br> regsub -all {\\002} $outmsg \002 outmsg<br> switch $greet(notification) {<br>  1 {putserv "PRIVMSG $chan :$outmsg"}<br>  2 {putserv "PRIVMSG $nick :$outmsg"}<br>  3 {putserv "NOTICE $nick :$outmsg"}<br>                             }<br>}<br><br>proc randomline {text} {<br> return [lindex $text [rand [llength $text]]]<br>}<br><br>proc greetchan {chan} {<br> global greet<br> set chan [string tolower $chan]<br> set chans [string tolower $greet(chans)]<br> if {$chan == "*"} {set chans [string tolower [channels]]}<br> set dothechan 0<br> foreach c $chans {<br>  if {($chan == $c)} {set dothechan 1}<br>                  }<br> if {$dothechan == 0} {return 0} else {return 1}<br>}<br><br><br>proc probability {prob} {<br> if {$prob == 100} {return 1}<br> set r [rand 100]<br> set rng [rand [expr 100 - $prob]]<br> set rngu [expr $rng + $prob]<br># putlog "prob:$prob r:$r range: $rng - $rngu"<br> if {($r &gt; $rng) &amp;&amp; ($r &lt; $rngu)} {return 1}<br> return 0<br>}<br><br>I am not exactly sure what to do to fix it.  Everytime I "fiddle" I seem to upset something and every nick that enters a channel ends up getting greeted, which is not what I want.<br><br>Many thanks for *any* help on this. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>PS: This script is about 3 years old.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Aug 22, 2003 5:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
