Code: Select all
#Mode Protection
bind mode - * modes
proc modes {nick uhost hand chan mode victim} {
global botnick owner
if {$nick == "$botnick"} { return 0 }
if {![isop $botnick $chan]} {
putquick "PRIVMSG X :op $chan" -next
if {[file exists netbots/getops.tcl] || [file exists scripts/getops.tcl]} {
set bot [getbot $chan]
putbot $bot "gop op $chan $botnick" }}
if {$mode == "-o" && [isbotnick $victim]} {
if {![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "PRIVMSG X :op $chan" -next
pushmode $chan -o-v+b $nick $nick [nick2hand $nick $chan]
putquick "KICK $chan $nick Dont Ever Deop Me" -next }
if {$mode == "-o" && [ischanset $chan protectops]} {
if {![matchattr [nick2hand $nick $chan] o]} {continue}
if {[isop $victim $chan]} {
putquick "MODE $chan -o-v+o+b $nick $nick $victim [nick2hand $nick $chan]" -next
putquick "KICK $chan $nick Operators Are Protected." -next }}
if {$mode == "-o" && [ischanset $chan protectusers]} {
if {![matchattr [nick2hand $nick $chan] o]} {continue}
if {[matchattr [nick2hand $victim $chan] &o $chan] || [matchattr [nick2hand $victim $chan] o]} {
putquick "MODE $chan -o-v+o+b $nick $nick $victim [nick2hand $nick $chan]" -next
putquick "KICK $chan $nick Users Are Protected." -next }}
if {$mode == "-v" && [ischanset $chan protectvoice]} {
if {![matchattr [nick2hand $nick $chan] o]} {continue}
if {[isvoice $victim $chan]} {
putquick "MODE $chan -o-v+v $nick $nick $victim" -next
putnotc $nick "Voiced Users Are Protected In Chan." }}
if {$mode == "+b" && [ischanset $chan protectusers]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
if {[matchattr $victim &o $chan] || [matchattr $victim o]} {
putquick "MODE $chan -b-o-v+b $victim $nick $nick [nick2hand $nick $chan]" -next
putquick "KICK $chan $nick Users Are Protected." -next }}
if {$mode == "+i" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &m $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan -i" -next
putquick "MODE $chan -o-v $nick $nick" -next
putquick "KICK $chan $nick You Have No Access To Set +i" -next }
if {$mode == "-i" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &m $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan +i" -next
putquick "MODE $chan -o-v $nick $nick" -next
putquick "KICK $chan $nick You Have No Access To Set -i" -next }
if {$mode == "+s" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan -s" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To +s" }
if {$mode == "-s" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan +s" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To -s" }
if {$mode == "+p" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan -p" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To +p" }
if {$mode == "-p" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan +p" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To -p" }
if {$mode == "+k *" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &n $chan] || ![matchattr [nick2hand $nick $chan] m]} {continue}
set what [lindex $mode 1]
putquick "MODE $chan -k $what" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To +k" }
if {$mode == "+m" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan -m" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To +m" }
if {$mode == "-m" && [ischanset $chan protectchan]} {
if {![matchattr [nick2hand $nick $chan] &o $chan] || ![matchattr [nick2hand $nick $chan] o]} {continue}
putquick "MODE $chan +m" -next
putquick "MODE $chan -o-v $nick $nick" -next
putnotc $nick "Sorry But You Dont Have Access To Set The Channel To -m" }
return 1 }
#Mode Protection
Can you help me please.Tcl error [modes]: invoked "continue" outside of a loop