Some propositions, face to a lot of errors, i think. Look at that!

[code]
On *:Join:#: {
if ($nick == $me) { .timerAV 0 10 autovoice $chan }
; On join, everybody is a regular user, so you should wait to see
; if a mode will be given to the user, some seconds later.

else { mode $chan +v $nick }
}
;
On me:*:Part:#: { .timerAV off }
;
; timer will be stopped if someone (not you) leaves IRC, useless.
on *:quit: { .timerAV off }
;
; timer will be stopped if you kick a user (and not if you are kicked), useless.
on me:*:kick:3:{ .timerAV off }
;
; timer won't be stopped if you just disconnect, so useless too.
on *:exit: { .timerAV off }
;
on @*:action:*:#:{
if ($nick isreg $chan) mode $chan +v $nick
}

On @*:Text:*:#: {
if ($nick isreg $chan) mode $chan +v $nick
}
;
alias autovoice {
var %x = $nick($1,0,v)
; why not stop the perform if you are not opped before the while ? (more efficient, faster)
while (%x) && ($me isop $1) {
; why checking if you are one of the voiced nick, where as you already checked
: if you are Opped on the channel ?

if (($nick($1,%x,v).idle >= 1200) && ($nick($1,%x,v) != $me)) {
; you are using 3 times $nick($1,%x,v), why not put it in a variable ?
msg $1 $nick($1,%x,v) You've been devoiced because you haven't $&
been saying nothing for over 20 minutes now
mode $1 -v $nick($1,%x,v)
}
dec %x
}
}
[code]




So, i propose you this code, just an idea, but better I think:

[code]
; >> LAUNCH TIMER:
; When you join, we launch the timer (60 seconds here,
; previous 10 seconds seems not more efficient)
On me:*:Join:#:timerAV 0 60 autovoice $chan
;
; >> CHECK IF USER IS REGULAR, AND VOICED HIM
; When a user joins, if you are opped you launch a timer, which will check if the
; user is regular some seconds later (a bot can give him a mode while)
On @!*:Join:#:timer 1 2 givevoice $chan $nick
;
On @*:action:*:#:givevoice $chan $nick
On @*:Text:*:#:givevoice $chan $nick
;
; >> CLOSE TIMER
; when you are kicked, when you leave a channel, when you disconnect.
On *:Kick:#:if ($knick == $me) timerAV off
On me:*:Part:#:timerAV off
On *:Disconnect:timerAV off
;
;
;
; >> ALIASES
; Check if the user is regular, and voice him, if it is the case.
alias givevoice {
if ($2 isreg $1) mode $v2 +v $v1
}
;
;
;
alias autovoice {
; if i am not opped, we stop this checking alias
if ($me !isop $1) return
; we put the channel name in %chan, for later
%chan = $1
; we send all voiced nick to the checkvoice alias
; (all words in the nicklist with a + prefix)
; ( interesting to see how that works, instead of a while
; (although /while is interesting too in this case) )
filter -wwlk $1 checkvoice +*
}
;
;
;
alias checkvoice {
; we put the nick in %nick, without the + prefix
var %nick $right($1,-1)
; if his idle is >= 1200, we send message and voiced the user.
if ($nick(%chan,%nick).idle >= 1200) {
msg %chan %nick You've been devoiced because you haven't been $&
saying nothing for over 20 minutes now
mode %chan -v %nick
}
}
[code]

.. so just an idea, as i said.

Last edited by CoolWave; 23/01/06 08:29 AM.