Code: Select all
set idle_interval "6"
set idle_time "5"
set idle_exclude_bots "1"
set idle_channels "#channel1 #channel2 #channel3"
bind raw - 317 idlecheck
proc idlecheck {nick int arg} {
global idle_time idle_channels
set nick [string tolower [lindex $arg 1]]
set idle [string tolower [lindex $arg 2]]
set minutesidle [expr $idle / 60]
if {$minutesidle > $idle_time && $nick != "^pagli^" && $nick != "Pakistani1" && $nick != "n0mercy" && $nick != "Go|dLeaf" && $nick != "priya007" && $nick != "^ash^" && $nick != "PehReDaaR" && $nick != "pinky^" && $nick != "bilal" && $nick != "huzur" && $nick != "janat" } {
foreach channel $idle_channels {
putserv "PRIVMSG Chanserv@services.dal.net :deop $channel $nick"
putserv "PRIVMSG $channel :deoped $nick from $channel (too Much Idle)"
putserv "privmsg $nick :deoped u from $channel (too much idle)"
}
}
}
proc perform_whois { } {
global idle_channels botnick idle_exclude_bots idle_interval
if {$idle_channels == " "} {
set idle_temp [channels]
} else {
set idle_temp $idle_channels
}
foreach chan $idle_temp {
foreach person [chanlist $chan] {
if { [isop $person $chan]} {
if {$idle_exclude_bots == 1} {
if {(![matchattr [nick2hand $person $chan] b]) && ($person != $botnick) && $person != "topguard" && $person != "pr0b"} { putserv "WHOIS $person $person" }
}
if {$idle_exclude_bots == 0} {
if {$person != $botnick} { putserv "WHOIS $person $person" }
}
}
}
}
if {![string match "*time_idle*" [timers]]} {
timer $idle_interval perform_whois
}
}
if {![string match "*time_idle*" [timers]]} {
timer $idle_interval perform_whois
}
but when i add multiple channels .. it tries to deop idle nicks on all the channels even if the nick is not in that channel ..
eg if nick1 is oped in #channel1 and the script is turned on in #channel1 #channel2 #channel3
the bot sends
msg chanserv@services.dal.net deop #channel1 nick1
msg chanserv@services.dal.net deop #channel2 nick1
msg chanserv@services.dal.net deop #channel3 nick1
even if nick1 is not on #channel2 and #channel3
can some one please tell me how to fix this ?