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

	<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-01-15T02:53:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-15T02:53:17-04:00</updated>

		<published>2009-01-15T02:53:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86930#p86930</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86930#p86930"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86930#p86930"><![CDATA[
Thanks,<br><br>How do I make a join bind for this one<br>I tried code from post #2 in this thread by speechles but I don't get what text this code below is asking for...<br><br>I also put in....<br><br>bind join - * tgstart<br><br>but it says: <span style="color:red">Tcl error [tgstart]: wrong # args: should be "tgstart nick host hand chan text"</span><br><br><br><div class="codebox"><p>Code: </p><pre><code>################################################################################starts the game if it isn't running.proc tgstart {nick host hand chan text} {global tgplaying tgstreak tgchan tgerrremindtime tgerrremindtimer tgmissed tgchoosecmd tgcheatif {[strlwr $tgchan]==[strlwr $chan]} {if {$tgplaying==0} {if {$tgcheat != "ON"} {set tgcheat "OFF"}tggamemsg "Trivia Game Started."tgnextqset tgplaying 1set tgstreak 0set tgmissed 0set tgerrremindtimer [timer $tgerrremindtime tgerrremind]}}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Thu Jan 15, 2009 2:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-12T21:45:07-04:00</updated>

		<published>2009-01-12T21:45:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86894#p86894</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86894#p86894"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86894#p86894"><![CDATA[
<blockquote class="uncited"><div>Have it way you showed me but get error when I try to start<br><div class="codebox"><p>Code: </p><pre><code>Tcl error [pub_hangmanstart]: can't read "::restarthangman(nick)": no such variable</code></pre></div></div></blockquote>HAW, sorry cache.. that was me being a dumbass. Setting isn't allowed to the value, and setting to the name doesn't require the $. This was my mistake. ;/<div class="codebox"><p>Code: </p><pre><code>set $::restarthangman(nick) $nickset $::restarthangman(uhost) $uhostset $::restarthangman(hand) $handset $::restarthangman(chan) $chan </code></pre></div>Simply remove those $ off the ::'s and everything will work as it should have to begin with, my bad..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><div class="codebox"><p>Code: </p><pre><code>set ::restarthangman(nick) $nickset ::restarthangman(uhost) $uhostset ::restarthangman(hand) $handset ::restarthangman(chan) $chan </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jan 12, 2009 9:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T19:15:38-04:00</updated>

		<published>2009-01-11T19:15:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86873#p86873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86873#p86873"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86873#p86873"><![CDATA[
Have it way you showed me but get error when I try to start<br><div class="codebox"><p>Code: </p><pre><code>Tcl error [pub_hangmanstart]: can't read "::restarthangman(nick)": no such variable</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 7:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-11T19:01:02-04:00</updated>

		<published>2009-01-11T19:01:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86871#p86871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86871#p86871"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86871#p86871"><![CDATA[
Use the code I gave above, which has the proper join bound to the join proc and pub to pub, then simply use this proc in place of the one you already have.<div class="codebox"><p>Code: </p><pre><code>proc hangman_abort {tried here} {global hangman tried hereif {$hangman(dtimer) != ""} {killutimer $hangman(dtimer)}set chan $hangman(chan)putquick "PRIVMSG $chan :The hangman game has ended. Next game in 15 seconds.."putquick "PRIVMSG $chan :Puzzle $hangman(puzzle)"set hangman(trys) 0hangman_saveutimer 15 [list join_hangmanstart $::restarthangman(nick) $::restarthangman(uhost) $::restarthangman(hand) $::restarthangman(chan)]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jan 11, 2009 7:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T18:57:57-04:00</updated>

		<published>2009-01-11T18:57:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86870#p86870</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86870#p86870"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86870#p86870"><![CDATA[
lol sorry trying to understand what part to rename, i just crahed  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-11T18:49:46-04:00</updated>

		<published>2009-01-11T18:49:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86869#p86869</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86869#p86869"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86869#p86869"><![CDATA[
<blockquote class="uncited"><div>Thank you..<br><br>Just wonder if I did this right? I get error can't read restarthangman(chan) no such var...<br><div class="codebox"><p>Code: </p><pre><code>set $::restarthangman(chan) $nick set $::restarthangman(nick) $uhost set $::restarthangman(nick) $hand set $::restarthangman(nick) $chan</code></pre></div></div></blockquote><div class="codebox"><p>Code: </p><pre><code>set $::restarthangman(nick) $nickset $::restarthangman(uhost) $uhostset $::restarthangman(hand) $handset $::restarthangman(chan) $chan</code></pre></div>They need to be named like this and then it will work. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Also, recheck your script. You will have an error again regarding arguments. You've somehow removed the join proc and are binding it again to the pub proc. You can't do this the arguments don't match. This is why you make a stub procedure for join, to add the extra argument rest and then invoke the normal pub procedure.<div class="codebox"><p>Code: </p><pre><code>bind pub -|- [cmdchar]hangmanstart pub_hangmanstartbind join -|- * join_hangmanstartproc join_hangmanstart {nick uhost hand chan} {  pub_hangmanstart $nick $uhost $hand $chan "1"}proc pub_hangmanstart {nick uhost hand chan rest} {global hangmanset $::restarthangman(nick) $nickset $::restarthangman(uhost) $uhostset $::restarthangman(hand) $handset $::restarthangman(chan) $chan..rest of script continues...</code></pre></div>Then use this timer when the game ends to restart it.<div class="codebox"><p>Code: </p><pre><code>utimer 15 [list join_hangmanstart $::restarthangman(nick) $::restarthangman(uhost) $::restarthangman(hand) $::restarthangman(chan)]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jan 11, 2009 6:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T18:48:08-04:00</updated>

		<published>2009-01-11T18:48:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86868#p86868</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86868#p86868"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86868#p86868"><![CDATA[
Thank you..<br><br>Just wonder if I did this right? I get error can't read restarthangman(chan) no such var...<br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- [cmdchar]hangmanstart pub_hangmanstart bind join -|- * pub_hangmanstart proc pub_hangmanstart {nick uhost hand chan rest} { set $::restarthangman(chan) $nick set $::restarthangman(nick) $uhost set $::restarthangman(nick) $hand set $::restarthangman(nick) $changlobal hangman  if {$hangman(trys) &gt; 0} {putserv "NOTICE $nick :Hangman game allready in progress on $hangman(chan)."                           return 0}  if {($rest &gt; 0) &amp;&amp; ($rest &lt;4)} {set hangman(level) $rest}  if {![file exists $hangman(datafile)]} {      putserv "NOTICE $nick :$hangman(datafile) not found."      return 0                                         }  set rest [hangman_pick]  set hangman(started) "RandomSelection"  hangman_start $chan $nick $rest }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 6:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-11T18:34:09-04:00</updated>

		<published>2009-01-11T18:34:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86866#p86866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86866#p86866"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86866#p86866"><![CDATA[
<blockquote class="uncited"><div>Where do I add the 4 varibles?<br><br><br>proc hangman_abort {<span style="color:red">tried here</span>} {<br>global hangman <span style="color:red">tried here</span><br> if {$hangman(dtimer) != ""} {killutimer $hangman(dtimer)}<br> set chan $hangman(chan)<br> putquick "PRIVMSG $chan :The hangman game has ended. Next game in 15 seconds.."<br> putquick "PRIVMSG $chan :Puzzle $hangman(puzzle)"<br> set hangman(trys) 0<br> hangman_save<br><br>}</div></blockquote>See up above, how chan is set using $hangman(chan). $hangman(chan) is a global variable. The global line contains the array's prefix, hangman. So all within that array are localized as well. This is how that script is using re-association within itself.<br><span style="font-size:84%;line-height:116%">Note: notice the passed variables 'tried' and 'here' are also globalized. This is a cheap way to pass local variables into global space.</span><br><br>The easiest way to do this yourself is to make new globals to use to invoke at the end of your timer. So choose a new array, say restarthangman. Then to carry these across to your timer, add these to the beginning of the pub_hangmanstart proc:<div class="codebox"><p>Code: </p><pre><code>set $::restarthangman(nick) $nickset $::restarthangman(uhost) $uhostset $::restarthangman(hand) $handset $::restarthangman(chan) $chan</code></pre></div>Then add this wherever your presently adding the timer:<div class="codebox"><p>Code: </p><pre><code>utimer 15 [list join_hangmanstart $::restarthangman(nick) $::restarthangman(uhost) $::restarthangman(hand) $::restarthangman(chan)]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jan 11, 2009 6:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T18:11:48-04:00</updated>

		<published>2009-01-11T18:11:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86865#p86865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86865#p86865"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86865#p86865"><![CDATA[
Where do I add the 4 varibles?<br><br><br>proc hangman_abort {<span style="color:red">tried here</span>} {<br>global hangman <span style="color:red">tried here</span><br> if {$hangman(dtimer) != ""} {killutimer $hangman(dtimer)}<br> set chan $hangman(chan)<br> putquick "PRIVMSG $chan :The hangman game has ended. Next game in 15 seconds.."<br> putquick "PRIVMSG $chan :Puzzle $hangman(puzzle)"<br> set hangman(trys) 0<br> hangman_save<br>utimer 15 [list join_hangmanstart $nick $uhost $hand $chan]<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 6:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T17:46:34-04:00</updated>

		<published>2009-01-11T17:46:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86863#p86863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86863#p86863"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86863#p86863"><![CDATA[
ok thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-11T17:43:11-04:00</updated>

		<published>2009-01-11T17:43:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86862#p86862</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86862#p86862"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86862#p86862"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>utimer 15 [list join_hangmanstart $nick $uhost $hand $chan]...or..utimer 15 [list pub_hangmanstart $nick $uhost $hand $chan $rest]</code></pre></div>That is, IF.. the 4 variable requirements are used within the section where you've added this timer. If not, you will need to somehow re-associate them so that they can be passed through the timer.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jan 11, 2009 5:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-11T17:11:45-04:00</updated>

		<published>2009-01-11T17:11:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86860#p86860</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86860#p86860"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86860#p86860"><![CDATA[
Am trying tpo get the game to stay on.. after the script where it would say game over...<br><br>I added this<div class="codebox"><p>Code: </p><pre><code>utimer 15 pub_hangmanstarteven tried..utimer 15 join_hangmanstart</code></pre></div>I was hoping that tmer would set off these binds to make game start again..<br>bind pub -|- [cmdchar]hangmanstart pub_hangmanstart <br>bind join -|- * join_hangmanstart <br>proc join_hangmanstart {nick uhost hand chan} { <br>  pub_hangmanstart $nick $uhost $hand $chan "1" <br>} <br><br>Any idea what code I need to set off the proc pub_hangmanstart after it says game over?<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Sun Jan 11, 2009 5:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-08T22:33:23-04:00</updated>

		<published>2009-01-08T22:33:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86803#p86803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86803#p86803"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86803#p86803"><![CDATA[
Thank you! That works  <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=7220">cache</a> — Thu Jan 08, 2009 10:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-01-08T18:53:33-04:00</updated>

		<published>2009-01-08T18:53:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86797#p86797</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86797#p86797"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86797#p86797"><![CDATA[
The problem is the pub bind passes one too many arguments (rest) which is the rest of the input the user types. When a join occurs this argument is omitted. You can use the code below to achieve what your after <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><div class="codebox"><p>Code: </p><pre><code>bind pub -|- [cmdchar]hangmanstart pub_hangmanstartbind join -|- * join_hangmanstartproc join_hangmanstart {nick uhost hand chan} {  pub_hangmanstart $nick $uhost $hand $chan "1"}proc pub_hangmanstart {nick uhost hand chan rest} {global hangman if {$hangman(trys) &gt; 0} {putserv "NOTICE $nick :Hangman game allready in progress on $hangman(chan)."   return 0 } if {($rest &gt; 0) &amp;&amp; ($rest &lt;4)} {set hangman(level) $rest} if {![file exists $hangman(datafile)]} {     putserv "NOTICE $nick :$hangman(datafile) not found."     return 0 } set rest [hangman_pick] set hangman(started) "RandomSelection" hangman_start $chan $nick $rest}</code></pre></div>The join proc invokes the normal pub proc. It sets rest as "1" which will set the hangman level to 1. Since join doesn't allow the user to set this, you can modify the line below to the proper level you desire 1-4.<div class="codebox"><p>Code: </p><pre><code>pub_hangmanstart $nick $uhost $hand $chan "1"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jan 08, 2009 6:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2009-01-08T17:55:23-04:00</updated>

		<published>2009-01-08T17:55:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86796#p86796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86796#p86796"/>
		<title type="html"><![CDATA[adding bind join to script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86796#p86796"><![CDATA[
Hey all.<br><br>Am trying to add this line "bind join -|- * pub_hangmanstart" below to make the game auto start when anyone joins the room. But I get the error <span style="color:red">[07:43] Tcl error [pub_hangmanstart]: wrong # args: should be "pub_hangmanstart nick uhost hand chan rest"</span><br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- [cmdchar]hangmanstart pub_hangmanstartbind join -|- * pub_hangmanstartproc pub_hangmanstart {nick uhost hand chan rest} {global hangman if {$hangman(trys) &gt; 0} {putserv "NOTICE $nick :Hangman game allready in progress on $hangman(chan)."                           return 0} if {($rest &gt; 0) &amp;&amp; ($rest &lt;4)} {set hangman(level) $rest} if {![file exists $hangman(datafile)]} {     putserv "NOTICE $nick :$hangman(datafile) not found."     return 0                                        } set rest [hangman_pick] set hangman(started) "RandomSelection" hangman_start $chan $nick $rest}</code></pre></div>Can anyone please show me how or point me in direction to get it to work? Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Thu Jan 08, 2009 5:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
