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

	<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-07-31T11:16:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-31T11:16:12-04:00</updated>

		<published>2003-07-31T11:16:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24225#p24225</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24225#p24225"/>
		<title type="html"><![CDATA[Tcl scripting help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24225#p24225"><![CDATA[
<blockquote class="uncited"><div>the file remains in <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"></div></blockquote>I see two possible reasons for this:<br>1) You're not providing the right path. (check if {[file exists $yourfile]} before you try to delete it and add a warning message if it doesn't exist.)<br>2) You forgot to close the file/don't have permission to delete it for some other reason. (this should cause an error)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jul 31, 2003 11:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-31T07:57:10-04:00</updated>

		<published>2003-07-31T07:57:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24221#p24221</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24221#p24221"/>
		<title type="html"><![CDATA[Tcl scripting help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24221#p24221"><![CDATA[
i make the command like<br><br>file delete -force pathname , and the file remains in <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=2778">the_crow</a> — Thu Jul 31, 2003 7:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-31T05:00:18-04:00</updated>

		<published>2003-07-31T05:00:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24215#p24215</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24215#p24215"/>
		<title type="html"><![CDATA[Re: :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24215#p24215"><![CDATA[
<blockquote class="uncited"><div>How can i make in tcl, to eggdrop del a file</div></blockquote><a href="http://www.tcl.tk/man/tcl8.4/TclCmd/file.htm#M12" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/file.htm#M12</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jul 31, 2003 5:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-30T20:36:15-04:00</updated>

		<published>2003-07-30T20:36:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24211#p24211</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24211#p24211"/>
		<title type="html"><![CDATA[:)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24211#p24211"><![CDATA[
I have solved all my problems thanks to you. Thank you man <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Can i make one more question?!?!<br>How can i make in tcl, to eggdrop del a file, after he created the file??<br>Thanks<br>I try to use the command exec rm $file but it didn't work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2778">the_crow</a> — Wed Jul 30, 2003 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-30T18:30:02-04:00</updated>

		<published>2003-07-30T18:30:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24205#p24205</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24205#p24205"/>
		<title type="html"><![CDATA[and by the way]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24205#p24205"><![CDATA[
<blockquote class="uncited"><div>Yes, i really understood</div></blockquote>No, you didn't, or you would not have asked the question you asked.<blockquote class="uncited"><div>So if i want to put another text in other variable after the first one text insert, should i do this?!<br>    set test $a <br>    unset triggedBy <br>    putserv "PRIVMSG $n :ok" <br>    putserv "PRIVMSG $n : Insert another thing:"<br>    set test2 $a<br>    unset triggedBy<br>    putserv "PRIVMSG $n : Ok again"</div></blockquote>This is what happens: Each time you trigger the msgm bind, the enire body of the proc is evaluated, and it has to return before anything else (except from the code currently being executed) can happen. There's no magic pause inserted at runtime to wait for more messages to arrive, just because you send a msg to a user asking for more info. The message is sent after the proc has returned, so you'll end up storing the same answer twice and asking more info that you won't store. (because the variable that is used to identify the user is unset (see complete code in your original post))<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jul 30, 2003 6:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-30T18:08:55-04:00</updated>

		<published>2003-07-30T18:08:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24204#p24204</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24204#p24204"/>
		<title type="html"><![CDATA[Re: again me 3 :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24204#p24204"><![CDATA[
<blockquote class="uncited"><div>But the putserv "PRIVMSG $n: this message don't appear" the bot dont say in pvt , why can it be!??!?!</div></blockquote>Probably because "$n:" ain't on irc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jul 30, 2003 6:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-30T14:42:09-04:00</updated>

		<published>2003-07-30T14:42:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24195#p24195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24195#p24195"/>
		<title type="html"><![CDATA[Tcl scripting help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24195#p24195"><![CDATA[
I solved the problem, i made a proc, and call him, after i close the file and worked <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=2778">the_crow</a> — Wed Jul 30, 2003 2:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-30T11:04:17-04:00</updated>

		<published>2003-07-30T11:04:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24191#p24191</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24191#p24191"/>
		<title type="html"><![CDATA[again me 3 :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24191#p24191"><![CDATA[
Hello.<br>I have made some thing like you said. <br>But i cant understand one thing.<br>I have made the tcl to put the variable inside a file so, i made the following<div class="codebox"><p>Code: </p><pre><code>.... proc survey:msgm {n u h a} {    global surveyQ surveyA    if {[info exists surveyA($u)]} {       lappend surveyA($u) $a       if {[llength $surveyA($u)]&lt;[llength $surveyQ]} {          # there are more questions to be asked...          putserv "PRIVMSG $n :[lindex $surveyQ [llength $surveyA($u)]]"       } {          # completed         set fp [open $n a]         puts $fp "..."         .......          close $fp         putserv "PRIVMSG $n: This message don't appear "         putserv "PRIVMSG $n :We're done. Now go away!"          putlog "$n has completed the survey:"          foreach q $surveyQ a $surveyA($u) {             putlog "Q: $q"             putlog "A: $a"          }          # DON'T keep surveyA($u) after completion. If you want tokeepthe          # list of answers use a different variable.          unset surveyA($u) </code></pre></div>But the putserv "PRIVMSG $n: this message don't appear" the bot dont say in pvt , why can it be!??!?!<br><br>Thks one more time <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=2778">the_crow</a> — Wed Jul 30, 2003 11:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-29T08:27:08-04:00</updated>

		<published>2003-07-29T08:27:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24163#p24163</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24163#p24163"/>
		<title type="html"><![CDATA[Tcl scripting help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24163#p24163"><![CDATA[
lindex $surveyA($u) &lt;INDEX&gt; will give you the answers by number...just set the variables from within the "completed" part. (before it's unset)<br>Or insert this (at the same point):<div class="codebox"><p>Code: </p><pre><code>global Question1 Question2 Question3foreach {Question1 Question2 Question3} $surveyA($u) break</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jul 29, 2003 8:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-29T07:00:24-04:00</updated>

		<published>2003-07-29T07:00:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24160#p24160</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24160#p24160"/>
		<title type="html"><![CDATA[sorry]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24160#p24160"><![CDATA[
Sorry just respond now, i went in a trip <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Yes, i really understood <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>But can it be possible, each question, have one variable separate, just imagine:<br><br>First question to variable Qestion1<br>Second question to variable Question2<br>Third Question to variable question3<br><br>to when i want to access the variable i make $question1, $question2 or $question3<br><br>If this possible??<br><br>Thks one more time <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=2778">the_crow</a> — Tue Jul 29, 2003 7:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-27T13:09:17-04:00</updated>

		<published>2003-07-27T13:09:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24041#p24041</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24041#p24041"/>
		<title type="html"><![CDATA[Re: Again me 2 :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24041#p24041"><![CDATA[
<blockquote class="uncited"><div>I understood <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>No you didn't...at least not entirely ;P<br><br>Try this: <div class="codebox"><p>Code: </p><pre><code># some questionsset surveyQ {"How old are you?""Where do you live?""Can I come over to your place?"}# the bindsbind pub - !survey survey:pubbind msgm - * survey:msgm# startproc survey:pub {n u h c a} { global surveyQ surveyAset surveyA($u) {}putserv "PRIVMSG $n :[lindex $surveyQ 0]"}# fetching the answersproc survey:msgm {n u h a} {global surveyQ surveyAif {[info exists surveyA($u)]} {lappend surveyA($u) $aif {[llength $surveyA($u)]&lt;[llength $surveyQ]} {# there are more questions to be asked...putserv "PRIVMSG $n :[lindex $surveyQ [llength $surveyA($u)]]"} {# completedputserv "PRIVMSG $n :We're done. Now go away!"putlog "$n has completed the survey:"foreach q $surveyQ a $surveyA($u) {putlog "Q: $q"putlog "A: $a"}# DON'T keep surveyA($u) after completion. If you want to keep the# list of answers use a different variable.unset surveyA($u)}}}</code></pre></div>Was that clear? If you have questions about parts of the code, please don't re-post the entire thing, and please use the code tag to keep it readable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Sun Jul 27, 2003 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-27T10:35:56-04:00</updated>

		<published>2003-07-27T10:35:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24028#p24028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24028#p24028"/>
		<title type="html"><![CDATA[Again me 2 :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24028#p24028"><![CDATA[
I understood <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>So if i want to put another text in other variable after the first one text insert, should i do this?!<br><br>bind pub - !trigger trigged <br>bind msgm - * input <br><br>proc trigged {n u h c a} { <br>  global triggedBy <br>  set triggedBy $u <br>  putserv "PRIVMSG $n :Type something:" <br>} <br><br>proc input {n u h a} { <br>  global triggedBy test <br>  global triggedBy test2<br>  if {[info exists triggedBy]&amp;&amp;[string eq $triggedBy $u]} { <br>    set test $a <br>    unset triggedBy <br>    putserv "PRIVMSG $n :ok" <br>    putserv "PRIVMSG $n : Insert another thing:"<br>    set test2 $a<br>    unset triggedBy<br>    putserv "PRIVMSG $n : Ok again"<br>  } <br>} <br><br>thks one more time <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=2778">the_crow</a> — Sun Jul 27, 2003 10:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-27T09:57:36-04:00</updated>

		<published>2003-07-27T09:57:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24022#p24022</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24022#p24022"/>
		<title type="html"><![CDATA[Re: again me]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24022#p24022"><![CDATA[
<blockquote class="uncited"><div>i put a trigger in a channel, like !teste, and then the bot, enter contact with me by pvt like this:<br><br>&lt;Bot&gt; Put a name:<br><br>then i put a name<br><br>&lt;me&gt; teste<br><br>Then the bot keeps the text "teste"  in the variable test <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>You mean GLOBAL variable, right? To catch the reply use a msgm bind. If you need to make sure the message you get is from the user typing the trigger you could store the nick and/or uhost of the person typing the trigger some where and check for the existance of a matching value in the proc triggered by the msgm bind.<br><br><br>eg:<div class="codebox"><p>Code: </p><pre><code>bind pub - !trigger triggedbind msgm - * inputproc trigged {n u h c a} {  global triggedBy  set triggedBy $u  putserv "PRIVMSG $n :Type something:"}proc input {n u h a} {  global triggedBy test  if {[info exists triggedBy]&amp;&amp;[string eq $triggedBy $u]} {    set test $a    unset triggedBy    putserv "PRIVMSG $n :ok"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Sun Jul 27, 2003 9:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2003-07-27T08:14:21-04:00</updated>

		<published>2003-07-27T08:14:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24019#p24019</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24019#p24019"/>
		<title type="html"><![CDATA[again me]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24019#p24019"><![CDATA[
Hi.<br>Thks by that, but it wasn't what i want to learn <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>imagine this.<br>i put a trigger in a channel, like !teste, and then the bot, enter contact with me by pvt like this:<br><br>&lt;Bot&gt; Put a name:<br><br>then i put a name<br><br>&lt;me&gt; teste<br><br>Then the bot keeps the text "teste"  in the variable test <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Can you explain me this!!?!?<br>Thks <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=2778">the_crow</a> — Sun Jul 27, 2003 8:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z_one]]></name></author>
		<updated>2003-07-27T06:45:43-04:00</updated>

		<published>2003-07-27T06:45:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=24014#p24014</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=24014#p24014"/>
		<title type="html"><![CDATA[Tcl scripting help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=24014#p24014"><![CDATA[
You must be a bot master or the bot owner for this to work.<br>In the pvt of the bot, you type <strong class="text-strong">- free me</strong> and the bot will store the value "free me" in the local variable <strong class="text-strong">test</strong><br><div class="codebox"><p>Code: </p><pre><code>bind msg m "-" mypvtcommandproc mypvtcommand {nick host hand arg} {   if {$arg == ""} {       putserv "PRIVMSG $nick :You must enter a command"   } else {     set test $arg  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=698">z_one</a> — Sun Jul 27, 2003 6:45 am</p><hr />
]]></content>
	</entry>
	</feed>
