I have a simple script:
Code: Select all
proc topic_set { nick host hand chan text } {
set fileid [open tristam-topic_theme.txt r]
gets $fileid topic_theme
close $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«"
} }
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
Here is the rest of the code btw, if anyone is interested what am I trying to do :>
Code: Select all
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_1
putserv "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_1
close $fileid
set fileid [open tristam-topic_2.txt r]
gets $fileid topic_section_2
putserv "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_1
close $fileid
set fileid [open tristam-topic_2.txt r]
gets $fileid topic_section_2
close $fileid
set fileid [open tristam-topic_3.txt r]
gets $fileid topic_section_3
putserv "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_1
close $fileid
set fileid [open tristam-topic_2.txt r]
gets $fileid topic_section_2
close $fileid
set fileid [open tristam-topic_3.txt r]
gets $fileid topic_section_3
close $fileid
set fileid [open tristam-topic_4.txt r]
gets $fileid topic_section_4
putserv "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_1
close $fileid
set fileid [open tristam-topic_2.txt r]
gets $fileid topic_section_2
close $fileid
set fileid [open tristam-topic_3.txt r]
gets $fileid topic_section_3
close $fileid
set fileid [open tristam-topic_4.txt r]
gets $fileid topic_section_4
close $fileid
set fileid [open tristam-topic_5.txt r]
gets $fileid topic_section_5
putserv "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"
} }