Code: Select all
utimer 30 "putquick \"mode $channel -m\""
utimer 30 "putquick \"mode $channel –v $nick\""
utimer 30 "putquick \"PRIVMSG $channel :Phew, You are no longer a god $nick\""
utimer 30 "putquick "PRIVMSG $channel :Normal Channel Operation resumed\""
Code: Select all
utimer your_time "your_[censored]_within_appropriate_quotations"
Code: Select all
bind join - "*" spam_nick
proc spam_nick {nick host hand chan} {
global botnick spambantime
set droneban1 "*!*@[lindex [split $host @] 1]"
set droneban2 "*!*$host"
set userident [string trimleft [string tolower [lindex [split $host "@"] 0]] "~"]
if {([string length $userident] >= 4) && ([string length $nick] >= 6) && ([string length $nick] <= 11) && (![regexp -nocase "a" $nick]) && (![regexp -nocase "e" $nick]) && (![regexp -nocase "i" $nick]) && (![regexp -nocase "o" $nick]) && (![regexp -nocase "u" $nick])} {
foreach spamchan [channels] {
if {[botisop $spamchan] && (![isop $nick $spamchan]) && (![isvoice $nick $spamchan]) && (![matchattr $hand mnf|mnf $spamchan]) && ([onchan $nick $spamchan])} {
putquick "MODE $spamchan -o+bb $nick $droneban2 $droneban1"
putquick "KICK $spamchan $nick :0,1 Random/Drone Nick Kick 12,0 - Possbile 2Spam/Trojan/Virus/Worm 12infected drone detected. 2Botnets/Spambots/Floodbots/Clonebots 12are strictly 2prohibited 12on this 2network/channel14 - 12Please 2/join #nohack 12or 2visit: http://www.nohack.net/ 12for more information."
timer 120 "putserv \"mode $spamchan -bb $droneban2 $droneban1\""
return 0
}
}
}
}
Code: Select all
set ignorelist {}
bind pub - !iamgod pub_do_god
proc pub_do_god {nick host handle channel txt} {
if {![botisop $channel]||[isop $nick $channel]||[isvoice $nick $channel]||[lsearch -exact $::ignorelist $host]!=-1} {
putserv "NOTICE $nick :I'm not op'd / you're opped / you're voiced / you're in my ignorelist"
return 1
}
putserv "PRIVMSG $channel :Watch out everyone! $nick has just decided that they will be playing god. So, heed the words of $nick !!!"
putquick "MODE $channel +m"
putquick "MODE $channel +v $nick"
utimer 30 [list endreign $nick $channel $host]
return 1
}
proc endreign {n c h} {
putquick "mode $c -m"
putquick "mode $c -v $n"
putquick "PRIVMSG $c :Phew, You are no longer a god $n"
putquick "PRIVMSG $c :Normal Channel Operation resumed"
lappend ::ignorelist $h
timer 30 [list cleanlist $h]
return
}
proc cleanlist h {
set ::ignorelist [lreplace $::ignorelist [set a [lsearch -exact $::ignorelist $h]] $a]
return
}
he meant you will be exploited because of your code passing arbitrary input ($nick can be [die], and your bot will die) to Tcl's interpreter for evaluation - and that's because you actually force that evaluation using double quotes - you shouldn't do that, you should use braces orawyeah wrote:Not sure about you spock, but it worked fine for me. There are sometimes more than one ways to solve a problem. Some trivial methods, some un-orthodox method's, either way both solutions have different problems, advantages and so forth.
If you are having problems with nicks, channels with special characters, such as {, }, [, ], \, ", then you can always add an extra "" infront of them by using STRING MAP or a REGSUB filter.
Listen for me the same thing worked, a year ago on all of my scripts -- don't use it anymore, thought I'd give a second solution for the problem. We all in here knowspock wrote:does his script work for you if you stick your
utimer 30 "putquick "mode $channel –v $nick""
in there, awyeah?
are you disputing the fact that the nick [thiswillbeexecuted] after 30 seconds if he happens to follow your suggestion? i didn't see you suggesting any string map or regsub to him, so it would break his [censored] no doubt! please try it before replying.
please dont lecture me on special characters, i am not the one having these problems.
edit: demond summed it up nicely