| View previous topic :: View next topic |
| Author |
Message |
krzys Voice
Joined: 16 Mar 2009 Posts: 5
|
Posted: Fri Jun 05, 2009 12:35 pm Post subject: Error with colours? |
|
|
Hi. I wrote script listening to announces of other bot and initiate shell script. This is the source:
| Code: | set do "no"
bind pubm - * uploaded
proc uploaded { nick host hand chan arg } {
if {$nick == "BotNick"} {
set got_custom_number [split $arg]
global stamp name cat size value rob
set stamp [lindex $got_custom_number 0 ]
regsub -all {14,1} $stamp "" stamp
putlog "Stamp is $stamp"
if {$stamp == "Znacznik1......:4"} {
set name [lindex $got_custom_number 1 ]
putlog "Name is $name"
set do no
}
if {$stamp == "Zacznik2..:3"} {
set cat [lindex $got_custom_number 1 ]
set do no
putlog "cat is $cat"
}
if {$stamp == "Znacznik3...:4"} {
set do yes
putlog "Now i can do my best!"
}
if {$do == "yes"} {
timer 20 "exec /home/eggdrop/script.sh $name $cat"
putlog "/scriptt.sh $name $cat"
}
}
} |
Here is sample log from mIRc with NNS from my channel:
Everytime i see "Stamp is Znacznik1......:4" etc.. but "Name is nazwa" neighter "cat is kategoria" Can you explain me why ? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Jun 05, 2009 2:39 pm Post subject: |
|
|
You are removing the color codes, but you don't remove the preceding control character. This messes up your string comparisons. Have a look at the stripcodes function. You'll find it documented in the doc/tcl-commands.doc file. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|