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.

channel message can shutdown eggdrop

Old posts that have not been replied to for several years.
Locked
j
jetsoni

channel message can shutdown eggdrop

Post by jetsoni »

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

Additions...

Post by jetsoni »

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.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

this line is the cause.

set msg [catch {expr $kaava} tulos]
Locked