This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
j
jetsoni
Post
by jetsoni » Fri Aug 02, 2002 1:53 pm
I tried to white a string containing [die] on my own channel and my bot died shortly after this. I couldn't track where and what did cause this. I tried adding check for *\[*\]*" in one of my scripts, but it dies before it gets that far.
--- laske.tcl ---
Code: Select all
bind pub - !laske pub:laske
proc pub:laske {nick uhost hand chan args} {
set kaava [join $args]
out_msg $nick $hand $chan "[string match *\[*\]* $kaava]"
if {[string match *\[*\]* $kaava] == 1} {
out_msg $nick $hand $chan "Ei saa suorittaa komentoja!"
return 0
}
set msg [catch {expr $kaava} tulos]
putlog "Laske: [join $args], error=$msg, tulos=$tulos"
if {$msg == 0} {
out_msg $nick $hand $chan "$kaava = $tulos"
} else {
out_msg $nick $hand $chan "$kaava: virhe kaavassa ($msg)"
}
}
--- end of laske.tcl ---
I tried also without the ' == 1' in the if clause.
j
jetsoni
Post
by jetsoni » Fri Aug 02, 2002 2:23 pm
I also tried to quote the pattern, but that didn't do the trick.
If I remove the whole script then it will not die, so it must be in somewhere above the if clause that causes the $kaava to be executed.
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Mon Aug 05, 2002 5:46 am
this line is the cause.
set msg [catch {expr $kaava} tulos]