mIRC Home    About    Download    Register    News    Help

Print Thread
#113602 06/03/05 07:09 PM
Joined: Mar 2005
Posts: 1
S
Mostly harmless
OP Offline
Mostly harmless
S
Joined: Mar 2005
Posts: 1
Hi,

I'm making a action that gives an +v who enters on a channel and doesn't have +o. But I need to wait 1 sec because the +o is given a litle bit later than user joins channel.
The problem is to make a if-else in timer event

Thanx

#113603 06/03/05 07:32 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Try this, exactly as I wrote it (including spaces everywhere), except for the 5 (interval in seconds), which you can change to whatever you want.
Code:
on !*:join:#yourchannel: .timer 1 [color:red]5[/color] if ($me isop # && $nick isreg # ) mode # +v $nick

However, keep in mind that using /if statements directly inside a /timer is not simple and can lead to results that you won't expect, unless you really know what you're doing. The simplest way around this is to make an alias that does everything you want (checks etc) and use that in /timer e.g.
Code:
on !*:join:#yourchannel: .timer 1 5 myvoice # $nick
alias myvoice {
  if $me isop $1 && $2 isreg $1 { mode # +v $2 }
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#113604 06/03/05 07:48 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You could use /pvoice too smile
Code:
on @*:join:#yourchannel:pvoice 5 # $nick

#113605 06/03/05 08:52 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I thought about that, but I was afraid that /pvoice would voice a user that just got opped (but not voiced). Does /pvoice halt after <delay> seconds if the user has in the meantime been opped?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#113606 06/03/05 09:06 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Sure does. smile


Link Copied to Clipboard