I have an error
Code: Select all
can't read "host": no such variable
while executing
"incr warn($host) 1"
(file "scripts/noaction.tcl" line 22)
invoked from within
"source scripts/noaction.tcl"
Code: Select all
can't read "host": no such variable
while executing
"incr warn($host) 1"
(file "scripts/noaction.tcl" line 22)
invoked from within
"source scripts/noaction.tcl"
Code: Select all
incr warn($host) 1
Code: Select all
if {[info exists warn]} {
set warn($host) 1
} else {
incr warn($host) 1
}
Code: Select all
utimer $warn(reset) {incr warn($host) -1 }
Code: Select all
utimer $warn(reset) [list action:reset $host]
Code: Select all
proc action:reset {host} {
global warn
if {[array names warn] != {}} {
if {[lsearch -nocase [array names warn] $host] > -1} {
if {$warn($host) > 1} {
incr warn($host) -1
} else {
unset warn($host)
}
}
}
}
Code: Select all
set warn($host) "0"
Code: Select all
unset warn($host)
Code: Select all
# Set max warnings before Punishment
set warn(max) "3"
# Set X time before timer undo's warning amount (in seconds)
set warn(reset) "60"
# Set Kick Reason
set warn(reason) "Hey No Action Please!"
######################
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick]} return
if {[matchattr $hand "ofmn|ofmm"]} return
if {[isop $nick $chan]} return}
if {[info exists warn]} {
set warn($host) 1
} else {
if {[info exists warn]} {
set warn($host) 1
} else {
incr warn($host) 1
}
}
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b $host"
putquick "KICK $chan $nick $warn(reason)"
unset warn($host)
} else {
putserv "PRIVMSG $chan :Warning $warn($host)"
utimer $warn(reset) [list action:reset $host]
}
}
proc action:reset {host} {
global warn
if {[array names warn] != {}} {
if {[lsearch -nocase [array names warn] $host] > -1} {
if {$warn($host) > 1} {
incr warn($host) -1
} else {
unset warn($host)
}
}
}
}
Code: Select all
if {[isop $nick $chan]} return}
Code: Select all
if {[isop $nick $chan]} return
Code: Select all
# Set max warnings before Punishment
set warn(max) "3"
# Set X time before timer undo's warning amount (in seconds)
set warn(reset) "120"
# Set Kick Reason
set warn(reason) "Hey No Action Please!"
######################
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }
if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }
if {[isop $nick $chan]} { return 0 }
if {![info exists warn($host)]} {
set warn($host) 1
utimer $warn(reset) [list action:reset $host]
} else { incr warn($host) }
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b *!$host"
putquick "KICK $chan $nick $warn(reason)"
} else {
putserv "PRIVMSG $chan :Warning $warn($host): No Action Please"
}
return 0
}
proc action:reset {host} {
global warn
if {[info exists warn($host)]} { unset warn($host) }
}
Code: Select all
# Set max warnings before Punishment
set warn(max) "4"
# Set X time before timer undo's warning amount (in seconds)
set warn(time) "120"
# Set Kick Reason
set warn(reason) "Hey No Action Please!"
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }
if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }
if {[isop $nick $chan]} { return 0 }
incr warn($host) +1
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b *!$host"
putquick "KICK $chan $nick $warn(reason)"
unset warn($host)
} else {
putserv "PRIVMSG $chan :Warning $warn($host)"
utimer $warn(time) [list action:reset $host]
}
}
proc action:reset {host} {
global warn
if {[array names warn] != {}} {
if {[lsearch -nocase [array names warn] $host] > -1} {
if {$warn($host) > 1} {
incr warn($host) -1
} else {
unset warn($host)
}
}
}
}
Code: Select all
if {[info exists warn($host)]} { unset warn($host) }
Code: Select all
# Set max warnings before Punishment
set warn(max) "4"
# Set X time before timer undo's warning amount (in seconds)
set warn(time) "120"
# Set Kick Reason
set warn(reason) "Hey No Action Please!"
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }
if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }
if {[isop $nick $chan]} { return 0 }
incr warn($host) +1
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b *!$host"
putquick "KICK $chan $nick $warn(reason)"
unset warn($host)
} else {
putserv "PRIVMSG $chan :Warning $warn($host)"
utimer $warn(time) [list action:reset $host]
}
}
proc action:reset {host} {
global warn
if {[array names warn] != {}} {
if {[lsearch -nocase [array names warn] $host] > -1} {
if {$warn($host) > 1} {
incr warn($host) -1
} else {
unset warn($host)
}
}
}
}
Code: Select all
# Set max warnings before Punishment
set warn(max) "3"
# Set X time before timer undo's warning amount (in seconds)
set warn(time) "22"
# Set Warn Message
set warn(reason2) "Please No Action "
# Set Kick Reason
set warn(reason) "NO Action /me! Do you understand?"
bind CTCP - ACTION action:avoid
proc action:avoid {nick host hand chan key text} {
global warn
if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }
if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }
if {[isop $nick $chan]} { return 0 }
incr warn($host) +1
if {$warn($host) > $warn(max)} {
putquick "MODE $chan +b *!$host"
putquick "KICK $chan $nick $warn(reason)"
unset warn($host)
} else {
putserv "PRIVMSG $chan :$warn(reason2) $warn($host) Warning"
utimer $warn(time) [list action:reset $host]
}
}
proc action:reset {host} {
global warn
if {[array names warn] != {}} {
if {[lsearch -nocase [array names warn] $host] > -1} {
if {$warn($host) > 1} {
incr warn($host) -1
} else {
unset warn($host)
}
}
}
}