mIRC Home    About    Download    Register    News    Help

Print Thread
#113602 06/03/05 07:09 PM
S
skeptomai
skeptomai
S
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,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
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 }
}

#113604 06/03/05 07:48 PM
I
Iori
Iori
I
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,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
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?

#113606 06/03/05 09:06 PM
I
Iori
Iori
I
Sure does. smile


Link Copied to Clipboard