i would need a script to put the mode +m on a chan when the channel is "x" time idle and remove it when noone talks in "x" time if the channel have just a certain number of ops, ou with a opcion on not detecting some flags like other bots so it doesnt put +M or -M when theres ops around
# What channel?
set lIdle(chan) "#yourchan"
# Lock after how many idle minutes?
set lIdle(itime) 30
# Unlock afte how many idle minutes?
set lIdle(iultime) 30
# Unlock only if the number of ops is less than: (including bot)
set lIdle(nops) 4
# Check for idle every x minutes.
set lIdle(citime) 10
if {[timerexists check:idle]==""} {
timer $lIdle(citime) "check:idle"
}
set lIdle(rtime) [unixtime]
bind pubm - "$lIdle(chan) *" idle:rec
proc idle:rec {nick uhost hand chan arg} {
global lIdle
if {![matchattr $hand f|f $chan]} {
set lIdle(rtime) [unixtime]
}
}
proc check:idle {} {
global lIdle
if {([unixtime]-$lIdle(rtime))/60 >= $lIdle(itime) && ![string match *m* [lindex [split [getchanmode $lIdle(chan)]] 0]]} {
pushmode $lIdle(chan) +m
set lIdle(lchan) 1
} elseif {([unixtime]-$lIdle(rtime))/60 >= $lIdle(iultime) && [string match *m* [lindex [split [getchanmode $lIdle(chan)]] 0]] && [getopnum] < $lIdle(nops)} {
pushmode $lIdle(chan) -m
}
timer $lIdle(citime) "check:idle"
}
proc getopnum {} {
global lIdle
set i 0
foreach user [chanlist $lIdle(chan)] {
if {[isop $user $lIdle(chan)]} {
incr i
}
}
set i
}
well, maybe for that guy for some weird reason it's useful, but setting +m on idle channel sounds completely pointless to me; +m is supposed to be used for flood protection and moderating
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use
demond wrote:well, maybe for that guy for some weird reason it's useful, but setting +m on idle channel sounds completely pointless to me; +m is supposed to be used for flood protection and moderating
I couldn't agree more. Could it be he wants to block timed "away" messages?
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM