egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error with colours?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
krzys
Voice


Joined: 16 Mar 2009
Posts: 5

PostPosted: Fri Jun 05, 2009 12:35 pm    Post subject: Error with colours? Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Jun 05, 2009 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber