I had an request script today some body with the nick : [die][die] requested a bot for #[die][die] and teh bot shut down.
How can i fixx this ?
Code: Select all
proc pub_request {nick host hand chan arg} {
putlog "ADD 1"
global botnick
#if {$chan == "#sicherheit"} {return 0}
set requests ""
if {![file exists "requests.txt"]} {return 0}
set infile [open "requests.txt" r]
while {![eof $infile]} {
gets $infile dataline
if {$dataline != ""} {lappend requests $dataline}
}
close $infile
set blockedchans ""
if {![file exists "blockedchans.txt"]} { return 0 }
set infile [open "blockedchans.txt" r]
while {![eof $infile]} {
gets $infile dataline
if {$dataline != ""} {lappend blockedchans $dataline}
}
close $infile
set blocked 0
set joinchan [lindex [split $arg] 0]
if {$joinchan == "#sicherheit"} {
puthelp "NOTICE $nick :Yo must not request for #sicherheit!!!"
newignore *!$host $botnick "Yo must not request for #sicherheit!!!" 1
return 0
}
foreach channel $blockedchans {
if {$channel == $joinchan} { set blocked 1 }
}
foreach channel $requests {
set channel [string tolower [lindex $channel 0]]
if {$channel == $joinchan} { set blocked 1 }
}
if {$blocked == 0} {
if {$chan == "#sicherheit"} {
putlog "ADD 2"
putlog "$nick requested a bot for $joinchan"
channel add $joinchan
channel set $joinchan -inactive
utimer 10 "checkchan $joinchan $nick $host"
#utimer 10 "set total \[llength \[chanlist $joinchan]]; if {\$total < 70 || !\[isop $nick $joinchan]} { puthelp \"NOTICE $nick :Either you haven't 70 user in your channel or you haven't op.\" } else { puthelp \"NOTICE $nick :Your request has been sent to John\"; puthelp \"PRIVMSG #sicherheit.intern :$nick!$host requested for $joinchan - \$total User\" }"
utimer 20 [list channel remove $joinchan]
putlog "ADD 3"
}
} else {
puthelp "NOTICE $nick :You're channel is blocked or the requests already stored! You must wait 5 minutes to try again!"
newignore *!$host $botnick "requested bots for a blocked channel" 5
putlog "$nick requested a bot for $joinchan altough this channel is blocked"
}
}
Code: Select all
utimer 10 "checkchan $joinchan $nick $host"
Code: Select all
utimer 10 [list checkchan $joinchan $nick $host]