Well, ill try to keep it simple, i already search the site for it, but can't find one like what i want.
I want a tcl that ONLY if a use a command like !idle , it detect's if someone have an idle bigger that, let's say, 1 hour, and kick's them from the channel, and if possible, not kicking users with Global Flag like "o".
# set here the user flag(s) required to use the command
set vIdleFlag m
# set here the command trigger
set vIdleTrigger !
# set here the user flag required in order to be exempt from a kick/ban
set vIdleExempt o
# set here the mode of operation
# 1 = kick only
# 2 = ban and kick
set vIdleMode 1
# set here the maximum allowed idle time (minutes)
set vIdleTime 60
proc pIdleTrigger {} {
global vIdleTrigger
return $vIdleTrigger
}
bind PUB $vIdleFlag [pIdleTrigger]idle pIdleCheck
proc pIdleCheck {nick uhost hand chan text} {
global vIdleExempt vIdleMode vIdleTime
if {[botisop $chan]} {
foreach user [chanlist $chan] {
if {![matchattr [nick2hand $user] $vIdleExempt $chan]} {
if {[getchanidle $user $chan] > $vIdleTime} {
switch -- $vIdleMode {
1 {putkick $chan $user "idle time exceeded"}
2 {
pushmode $chan +b *!$uhost
flushmode $chan
utimer 3 [list pIdleKick $chan $user]
}
default {}
}
}
}
}
}
return 0
}
proc pIdleKick {chan user} {
if {[onchan $user $chan]} {
putkick $chan $user "idle time exceeded"
}
return 0
}
# eof
# set here the user flag(s) required to use the command
set vIdleFlag m
# set here the command trigger
set vIdleTrigger !
# set here the user flag required in order to be exempt from a kick/ban
set vIdleExempt o
# set here the mode of operation
# 1 = kick only
# 2 = ban and kick
set vIdleMode 1
# set here the maximum allowed idle time (minutes)
set vIdleTime 60
proc pIdleTrigger {} {
global vIdleTrigger
return $vIdleTrigger
}
bind PUB $vIdleFlag [pIdleTrigger]idle pIdleCheck
proc pIdleCheck {nick uhost hand chan text} {
global vIdleExempt vIdleMode vIdleTime
if {[botisop $chan]} {
foreach user [chanlist $chan] {
if {![matchattr [nick2hand $user] $vIdleExempt $chan]} {
if {[getchanidle $user $chan] > $vIdleTime} {
switch -- $vIdleMode {
1 {putkick $chan $user "idle time exceeded"}
2 {
set host [maskhost [getchanhost $user $chan]]
pushmode $chan +b $host
flushmode $chan
utimer 3 [list pIdleKick $chan $user]
}
default {}
}
}
}
}
}
return 0
}
proc pIdleKick {chan user} {
if {[onchan $user $chan]} {
putkick $chan $user "idle time exceeded"
}
return 0
}
# eof
# set here the user flag(s) required to use the command
set vIdleFlag m
# set here the command trigger
set vIdleTrigger !
# set here the user flag required in order to be exempt from a kick/ban
set vIdleExempt o
# set here the mode of operation
# 1 = kick only
# 2 = ban and kick
set vIdleMode 1
# set here the maximum allowed idle time (minutes)
set vIdleTime 60
proc pIdleTrigger {} {
global vIdleTrigger
return $vIdleTrigger
}
bind PUB $vIdleFlag [pIdleTrigger]idle pIdleCheck
proc pIdleCheck {nick uhost hand chan text} {
global vIdleExempt vIdleMode vIdleTime
if {[botisop $chan]} {
foreach user [chanlist $chan] {
if {![isbotnick $user]} {
if {![matchattr [nick2hand $user] $vIdleExempt $chan]} {
if {[getchanidle $user $chan] > $vIdleTime} {
switch -- $vIdleMode {
1 {putkick $chan $user "idle time exceeded"}
2 {
set host [maskhost [getchanhost $user $chan]]
pushmode $chan +b $host
flushmode $chan
utimer 3 [list pIdleKick $chan $user]
}
default {}
}
}
}
}
}
}
return 0
}
proc pIdleKick {chan user} {
if {[onchan $user $chan]} {
putkick $chan $user "idle time exceeded"
}
return 0
}
# eof