| View previous topic :: View next topic |
| Author |
Message |
chandra Sha Voice

Joined: 31 Oct 2006 Posts: 12 Location: South Borneo
|
Posted: Tue Oct 31, 2006 1:40 am Post subject: DEOp and DEVoice on Idle |
|
|
I Found this deop on idle tcl on egghelp arcive
| Quote: | ###### configuration #####
die "DEOp on Idle STOP"
# set the interval between idlechecks in minutes
set idle_interval "1"
# set the idle-time an operator must have to get deopped by the bot in minutes
set idle_time "3"
# [0/1] do we want to exclude bots from being idle-deopped?
# generally a good idea
set idle_exclude_bots "1"
# set channels where idle-deopper should be active seperated by spaces
# set to " " for all
set idle_channels " "
#########################################################################################
## End of configuration ### Do Not edit anything here! ##################################
#########################################################################################
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} {
dccbroadcast "$nick has too much idle"
foreach channel $idle_channels {
putserv "MODE $channel -o $nick"
putserv "NOTICE $nick :You have been idle $idle_time Minutes on $channel Forced DeOp."
putlog "Took op from $nick on $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 {
dccbroadcast "Now checking \002$chan\002 for idle"
foreach person [chanlist $chan] {
if { [isop $person $chan]} {
if {$idle_exclude_bots == 1} {
if {(![matchattr [nick2hand $person $chan] b]) && ($person != $botnick)} { 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
}
putlog "DEOp on idle - deop.tcl \002LOADED\002!" |
It's work, and then i modify so it can devoice and save it to devoice.tcl
| Quote: | putserv "MODE $channel -v $nick"
putserv "NOTICE $nick :You have been idle $idle_time Minutes on $channel Forced DeVoiced."
putlog "Took voice from $nick on $channel (too much idle)" |
| Quote: | | if { [isvoice $person $chan]} { |
That work only if they load one by one ( load only deop.tcl or only devoice.tcl), but if i load together only deop.tcl work. any help me please... |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Oct 31, 2006 3:40 am Post subject: |
|
|
| Rename the proc names, variables, timers, etc. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|