Code: Select all
set testnum "+123"
set testnum2 "-123"
bind pub - !testnum proc:doshow
proc proc:doshow {nick uhost handle channel arg} {
global testnum testnum2
putserv "PRIVMSG $channel : TEST"
putserv "privmsg $channel : \0030,12»\0031,15 Nasdaq-100 Pre-Market Indicator > [expr $testnum<0?"\00304$testnum":"\00303$testnum"] \0031,15 ET \003]"
putserv "privmsg $channel : \0030,12»\0031,15 Nasdaq-100 Pre-Market Indicator > [expr $testnum2<0?"\00304$testnum2":"\00303$testnum2"] \0031,15 ET \003]"
}
Code: Select all
[expr $testnum<0?"\00304$testnum":"\00303$testnum"]
Well, if you want to insert spaces, all you have to do is add them to the "string map" command.NewzBoy wrote:Hi - I have this string that adds colour to pieces of data before it's sent to the channel - what I'm trying to do is add a space of either the red or green colour infront of $test, but not having any luck so far! any ideas? thanks!
set test [string map [list + \0030,3+ - \0030,4-] $num]
set test2 [string map [list + \0030,3+ - \0030,4-] [lindex $all 3]]
putserv "PRIVMSG $channel :\0030,12»\0031,15 Nasdaq-100 Pre-Market Indicator > [lindex $all 0] $test ($test2) \0031,15 [lindex $all 1] ET \003"