| View previous topic :: View next topic |
| Author |
Message |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Nov 16, 2005 2:05 pm Post subject: auto +M -M |
|
|
| 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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Nov 16, 2005 5:05 pm Post subject: |
|
|
| Code: | # 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
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Nov 16, 2005 8:01 pm Post subject: tks |
|
|
thank u very much  |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Nov 16, 2005 9:24 pm Post subject: one more thing |
|
|
| sorry but one more thing if i wanted to put a random number between two number to unlock what should i change, sorry to bother so much |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Nov 16, 2005 11:41 pm Post subject: |
|
|
Sir_Fz, your responsiveness to requests for completely useless scripts never cease to amaze me  _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 17, 2005 6:49 pm Post subject: Re: one more thing |
|
|
| .pt wrote: | | sorry but one more thing if i wanted to put a random number between two number to unlock what should i change, sorry to bother so much |
Didn't understand.
| demon wrote: | Sir_Fz, your responsiveness to requests for completely useless scripts never cease to amaze me |
I was in the mood  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Thu Nov 17, 2005 7:57 pm Post subject: random |
|
|
like this
set bla (10,25)
or
set bla1 10
set bla2 25
instead of the 30 timer for unlock, it will choose a random name between those two |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Nov 17, 2005 11:03 pm Post subject: |
|
|
| demond wrote: | Sir_Fz, your responsiveness to requests for completely useless scripts never cease to amaze me  |
Seems this "useless" script is getting more complicated.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Nov 18, 2005 1:53 am Post subject: |
|
|
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 [code] tag when posting logs, code |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Nov 18, 2005 2:48 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
|