set list_of_chans "#chan1 #chan2"
global botnick username
# interval in minutes between checks.
set check_interval 5
# allowed time in minutes for an op to be idle.
set op_allowed_time 45
# allowed time in minutes for a voiced user to be idle.
set vo_allowed_time 10
# nicks to be exempted from Deop/devoice
set exclude_nicks "nick1;nick2;nick3;"
set exclude_nicks [string tolower $exclude_nicks]
proc inactive_checker { chan } {
global exclude_nicks op_allowed_time vo_allowed_time botnick
if {![botisop $chan]} { return 0 }
foreach user [chanlist $chan] {
set user [string tolower $user]
if {![string match "*$user;*" $exclude_nicks] && ![matchattr [nick2hand $user $chan] f] } {
if {[isvoice $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) &&([getchanidle $user $chan] >= $vo_allowed_time)} {
putserv "mode $chan -vk $user Idle.Devoice"
}
if {[isop $user $chan] && ![onchansplit $user $chan] && ($user != $botnick) && ([getchanidle $user $chan] >= $op_allowed_time)} {
putserv "mode $chan -ok $user Idle.Op"
}
}
}
}
proc run_checking_timer { } {
global list_of_chans check_interval
foreach check_chan [split $list_of_chans] {
inactive_checker $check_chan
}
timer $check_interval run_checking_timer
}
timer $check_interval run_checking_timer
i found this tcl but this is not proper working .. i got this result when i apply on bot.. [07:49] * NoNSt0p sets mode: -ok NoNSt0p Idle.Op . but deop him/self but not other's . can any one corret me for this
set list_of_chans "#chan1 #chan2"
# interval in minutes between checks.
set check_interval 5
# allowed time in minutes for an op to be idle.
set op_allowed_time 45
# allowed time in minutes for a voiced user to be idle.
set vo_allowed_time 10
# nicks to be exempted from Deop
set op_exclude_nicks "nick1,nick2,nick3"
# nicks to be exempted from devoice
set vo_exclude_nicks "nick1,nick2,nick3"
set op_exclude_nicks [string tolower $op_exclude_nicks]
set vo_exclude_nicks [string tolower $vo_exclude_nicks]
proc inactive_checker { chan } {
global op_exclude_nicks vo_exclude_nicks op_allowed_time vo_allowed_time
if {![botisop $chan]} { return 0 }
foreach nk [chanlist $chan] {
set nk [string tolower $nk]
if {[isbotnick $nk] || [onchansplit $nk $chan]} { continue }
if {[matchattr [nick2hand $nk $chan] f]} { continue }
if {[isop $nk $chan] && ![string match "*,$nk,*" ",$op_exclude_nicks,"]} {
if {[getchanidle $nk $chan] >= $op_allowed_time} {
putserv "mode $chan -ok $nk Idle.Op"
}
}
if {[isvoice $nk $chan] && ![string match "*,$nk,*" ",$vo_exclude_nicks,"]} {
if {[getchanidle $nk $chan] >= $vo_allowed_time} {
putserv "mode $chan -vk $nk Idle.Devoice"
}
}
}
}
proc run_checking_timer { } {
global list_of_chans check_interval
foreach check_chan [split $list_of_chans] {
inactive_checker $check_chan
}
timer $check_interval run_checking_timer
}
timer $check_interval run_checking_timer
set list_of_chans "#sukoon"
# interval in minutes between checks.
set check_interval 5
# allowed time in minutes for an op to be idle.
set op_allowed_time 120
# allowed time in minutes for a voiced user to be idle.
set vo_allowed_time 60
# nicks to be exempted from Deop
set op_exclude_nicks "nick1,nick2,nick3"
# nicks to be exempted from devoice
set vo_exclude_nicks "nick1,nick2,nick3"
set op_exclude_nicks [string tolower $op_exclude_nicks]
set vo_exclude_nicks [string tolower $vo_exclude_nicks]
proc inactive_checker { chan } {
global op_exclude_nicks vo_exclude_nicks op_allowed_time vo_allowed_time
if {![botisop $chan]} { return 0 }
foreach nk [chanlist $chan] {
set nk [string tolower $nk]
if {[isbotnick $nk] || [onchansplit $nk $chan]} { continue }
if {[matchattr [nick2hand $nk $chan] f]} { continue }
if {[isop $nk $chan] && ![string match "*,$nk,*" ",$op_exclude_nicks,"]} {
if {[getchanidle $nk $chan] >= $op_allowed_time} {
putserv "mode $chan -ok $nk Idle.Op"
}
}
if {[isvoice $nk $chan] && ![string match "*,$nk,*" ",$vo_exclude_nicks,"]} {
if {[getchanidle $nk $chan] >= $vo_allowed_time} {
putserv "mode $chan -vk $nk Idle.Devoice"
}
}
}
}
proc run_checking_timer { } {
global list_of_chans check_interval
foreach check_chan [split $list_of_chans] {
inactive_checker $check_chan
}
timer $check_interval run_checking_timer
}
timer $check_interval run_checking_timer
i check this tcl it was working fine in starting but now it has started problem like .. devoice deop on idel time not working... here is the some result of.
<(MaSt3r> [12:56:00] Tcl error in script for 'timer22475':
<(MaSt3r> [12:56:00] illegal channel: #chan2
eXtreme-op has been idle 1hr 42mins 48secs, signed on Tue Jun 13 21:52:24 2017
MaSt3r sets mode: -vk eXtreme-op Idle.Devoice
[18:01] <F|irT> bot just devoice him after i rehsh the bot
[09:06] * MaSt3r sets mode: -ok DaD Idle.Op
DaD has been idle 5mins, signed on Sat Jul 22 14:04:48 2017
[09:06] * MaSt3r sets mode: -ok ZarNaH Idle.devoice
[09:15] ZarNaH has been idle 12mins 31secs, signed on Fri Jul 28 01:03:10 2017