Well i got a topic like this one: [Hot: N/A] [Cold: .51/823/856 .45/930/952 ] [Walked: .34 .233 .225 ]
and i got a script with the command: !calcip 51
-> i want the script to get the 2 numbers behind the .51 separated with / and to use them (e.g. $var1=51 $var2=823 and $var3=856)
-> the number of .xx/XXX/xxx in the topic varies sometimes there can be some under Hot: ....
bind pubm n "#dclone.eu !calcx *" pub:calcx
proc pub:calcx {nick uhost hand chan text} {
set text [split $text]
set topic [topic #dclone.eu]; regexp -nocase {.*\[cold: \.((\d)+)/((\d)+)/((\d)+).*} $topic a cipx(server) b cipx(lwe) c cipx(act)"
set cipx(min) [expr $cipx(lwe) + 75]; set cipx(max) [expr $cipx(lwe) + 125]; set cipx(tomin) [expr $cipx(min) - $cipx(act)]; set cipx(sold) [expr $cipx(act) - $cipx(lwe)]; set cipx(tomax) [expr $cipx(max) - $cipx(act)];
if {$cipx(tomin) > 0} { putmsg $chan "Server \[\002.$cipx(server)\002\] Minimum sojcount for WE is $cipx(min), while maximum is $cipx(max). $cipx(sold) sojs have been sold and $cipx(tomin) sojs need to be sold to reach minimum!" }
if {$cipx(tomin) == 0} { putmsg $chan "Server \[\002.$cipx(server)\002\] Minimum sojcount for WE is $cipx(min), while maximum is $cipx(max). $cipx(sold) sojs have been sold - minimum is reached." }
if {$cipx(tomin) < 0} {putmsg $chan "Server \[\002.$cipx(server)\002\] Minimum sojcount for WE is $cipx(min), while maximum is $cipx(max). $cipx(sold) sojs have been sold, min is reached and $cipx(tomax) more sojs need to be sold to max." }
}
array unset cipx
------> Tcl error [pub:calcx]: can't read "cipx(act)": no such variable
could you do sth like that -> \.((\d)+)/((\d)+)/((\d)+). :
[Hot: 1time HERE ] [Private WE's: IGNORE THIS PART COMPLETELY ] [Cold: 2times HERE ] [.... (ignore whhat follows the cold box imediatly)
=> 9 vars (3* .xx/zzz/yyy)
set them to anything i can change it