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

	<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-11-16T16:55:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Tristam]]></name></author>
		<updated>2003-11-16T16:55:09-04:00</updated>

		<published>2003-11-16T16:55:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30140#p30140</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30140#p30140"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30140#p30140"><![CDATA[
uuuuh now it all makes sense <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> thanks a lot once again! :&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3881">Tristam</a> — Sun Nov 16, 2003 4:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-11-16T16:51:06-04:00</updated>

		<published>2003-11-16T16:51:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30139#p30139</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30139#p30139"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30139#p30139"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set number 1switch -- $number {  "1" {    # do something with this number  }  "2" {    # do something with this number  }  "3" {    # do something with this number  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Nov 16, 2003 4:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Tristam]]></name></author>
		<updated>2003-11-16T16:12:09-04:00</updated>

		<published>2003-11-16T16:12:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30136#p30136</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30136#p30136"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30136#p30136"><![CDATA[
Hmm...<br><br>No TALES, that's what I can do already. The problem is, when I use if's and elseif's, that it stops after making all the commands. And if I use one if or elseif to make commands, I cant use if or elseif in the commands again..<br><br>caesar, I tried to look for an "switch" command, here it is: <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/switch.htm" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/switch.htm</a>. The only problem is that I dont understand it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Could you please help me out and make a _simple_ example of the usage? (I really dont understand how that command would help me with my problem..) <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>help a noobi, thanks :&gt;<br><br>EDIT:// I'll try to explain the problem again: First, I take a number from a text file, check it with <em class="text-italics">if</em> and <em class="text-italics">elseif</em> commands to set up few variables depending what's the number in the text file. After that, I want it to continue with a code, which gives different output depending which variables were set. I hope you understand it <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=3881">Tristam</a> — Sun Nov 16, 2003 4:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TALES]]></name></author>
		<updated>2003-11-15T06:44:03-04:00</updated>

		<published>2003-11-15T06:44:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30031#p30031</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30031#p30031"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30031#p30031"><![CDATA[
could be something like this ??<br><br>example:<div class="codebox"><p>Code: </p><pre><code>if {$topic_sections == "0"} { puthelp "PRIVMSG $chan :There is no topic set in $chan!"  } elseif {$topic_sections == "1"} {  #your code  set topic_sections "2" } elseif {$topic_sections == "2"} {  #your code  set topic_sections "1" } else {  #your code  set topic_section "1" }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4104">TALES</a> — Sat Nov 15, 2003 6:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-11-15T03:55:56-04:00</updated>

		<published>2003-11-15T03:55:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30025#p30025</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30025#p30025"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30025#p30025"><![CDATA[
Instead of a lot <em class="text-italics">ifs</em> and <em class="text-italics">elses</em> use the <em class="text-italics">switch</em> command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Nov 15, 2003 3:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Tristam]]></name></author>
		<updated>2003-11-14T20:29:10-04:00</updated>

		<published>2003-11-14T20:29:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30015#p30015</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30015#p30015"/>
		<title type="html"><![CDATA[Jumping to one proc after another]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30015#p30015"><![CDATA[
Yello! I would like to ask if there is a command in tcl similiar to "go to" or "then"..? Let me explain:<br><br>I have a simple script:<br><div class="codebox"><p>Code: </p><pre><code>proc topic_set { nick host hand chan text } { set fileid [open tristam-topic_theme.txt r]gets $fileid topic_themeclose $fileid  if {$topic_theme == "1"} {set t_start "7,1.::"set t_colour "15"set t_middle "7::"set t_end "7::."  } elseif {$topic_theme == "2"} {set t_start "1,14.::"set t_colour "0"set t_middle "1::"set t_end "1::."  } elseif {$topic_theme == "3"} {set t_start "7,1» 0» 7»"set t_colour "7"set t_middle "7«0?7»"set t_end "7« 0« 7«" } }</code></pre></div>See, it opens up a file and reads the value (which is set with a different command before, and sets the t_xxx variables according to what the value in the file is, understood? good <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">) So, I want it to "move" along with the script, or just "move" to another proc, which does the rest. I could fix it by typing the rest of it after each 1,2,3 varible chack commands, but that would make my code 47834786 lines long and stupid <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>So what I really want to know it: Is there a way to "jump" or "move" to another proc after finished the other? Or a command like "then". I hope you understand <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Here is the rest of the code btw, if anyone is interested what am I trying to do :&gt;<br><div class="codebox"><p>Code: </p><pre><code>set fileid [open tristam-topic_sections.txt r]gets $fileid topic_sections  if {$topic_sections == "0"} {puthelp "PRIVMSG $chan :There is no topic set in $chan!" } elseif {$topic_sections == "1"} {set fileid [open tristam-topic_1.txt r]gets $fileid topic_section_1putserv "TOPIC $chan :$t_start $t_colour $topic_section_1 $t_end"close $fileid } elseif {$topic_sections == "2"} {set fileid [open tristam-topic_1.txt r]gets $fileid topic_section_1close $fileidset fileid [open tristam-topic_2.txt r]gets $fileid topic_section_2putserv "TOPIC $chan :$t_start $t_colour $topic_section_1 $t_middle $t_colour $topic_section_2 $t_end"close $fileid } elseif {$topic_sections == "3"} {set fileid [open tristam-topic_1.txt r]gets $fileid topic_section_1close $fileidset fileid [open tristam-topic_2.txt r]gets $fileid topic_section_2close $fileidset fileid [open tristam-topic_3.txt r]gets $fileid topic_section_3putserv "TOPIC $chan :$t_start $t_colour $topic_section_1 $t_middle $t_colour $topic_section_2 $t_middle $t_colour $topic_section_3 $t_end"close $fileid } elseif {$topic_sections == "4"} {set fileid [open tristam-topic_1.txt r]gets $fileid topic_section_1close $fileidset fileid [open tristam-topic_2.txt r]gets $fileid topic_section_2close $fileidset fileid [open tristam-topic_3.txt r]gets $fileid topic_section_3close $fileidset fileid [open tristam-topic_4.txt r]gets $fileid topic_section_4putserv "TOPIC $chan :$t_start $t_colour $topic_section_1 $t_middle $t_colour $topic_section_2 $t_middle $t_colour $topic_section_3 $t_middle $t_colour $topic_section_4 $t_end"close $fileid } elseif {$topic_sections == "5"} {set fileid [open tristam-topic_1.txt r]gets $fileid topic_section_1close $fileidset fileid [open tristam-topic_2.txt r]gets $fileid topic_section_2close $fileidset fileid [open tristam-topic_3.txt r]gets $fileid topic_section_3close $fileidset fileid [open tristam-topic_4.txt r]gets $fileid topic_section_4close $fileidset fileid [open tristam-topic_5.txt r]gets $fileid topic_section_5putserv "TOPIC $chan :$t_start $t_colour $topic_section_1 $t_middle $t_colour $topic_section_2 $t_middle $t_colour $topic_section_3 $t_middle $t_colour $topic_section_4 $t_middle $t_colour $topic_section_5 $t_end"close $fileid } else {puthelp "PRIVMSG $chan :ERROR :P" } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3881">Tristam</a> — Fri Nov 14, 2003 8:29 pm</p><hr />
]]></content>
	</entry>
	</feed>
