Basically I want to evaluate a line from a list as I am outputting it...
Lines in the list will be something like:
0 15 (123ms) JohnnyRotten
1 24 (73ms) TomThumb
I want to look at the first character (either the 0 or 1) and then assign a color based on the number... Red for 0, Blue for 1... As I am pushing it via a putquick privmsg statement...
I know that the answer is probably quite obvious, and I have looked at the TCL docs... But I just can't get it figgered out...
I am guessing that it will be something like:
Code: Select all
foreach output_line $output_list {
if {[string range $output_line 0 0]}==0{
putquick "PRIVMSG $nick : \00304,99 $output_line"
} elseif {[string range $output_line 0 0]}==1{
putquick "PRIVMSG $nick : \00302,99 $output_line"
} else {
putquick "PRIVMSG $nick : \00301,99 $output_line"
}
}