mIRC Home    About    Download    Register    News    Help

Print Thread
#13825 02/03/03 09:22 PM
Joined: Feb 2003
Posts: 21
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 21
How would I go about putting an 'or' in an if statement.
What is the command for or?

on *:join:#channame: if $nick == MrMagooba || Magooba { msg VoiceBot VOICE MrMagooba }
|| = 'or' (best guess)

Would this work?

#13826 02/03/03 09:31 PM
Joined: Feb 2003
Posts: 27
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Feb 2003
Posts: 27
something like

Code:
on *:join:#channel: {
if ($nick == MrMagooba) || ($nick == Magooba) { 
 msg VoiceBot VOICE $nick 
 }
} 

Last edited by Lowest; 02/03/03 09:32 PM.
#13827 02/03/03 10:00 PM
Joined: Feb 2003
Posts: 3
N
Self-satisified door
Offline
Self-satisified door
N
Joined: Feb 2003
Posts: 3
Code:
on *:join:#:if ($nick == MrMagooba || $nick == Magooba) msg VoiceBot VOICE $nick

#13828 02/03/03 10:08 PM
Joined: Feb 2003
Posts: 21
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 21
Thanks, I'll give 'em a bash.

#13829 02/03/03 10:22 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
There are MANY ways of accomplishing the same thing in mIRC scripting (as in most languages).

If-Then-Else:
on *:JOIN:#: if ($nick == MrMagooba || $nick == Magooba) msg VoiceBot VOICE $nick

Tokens:
on *:JOIN:#: if ($istok(MrMagooba Magooba, $nick, 32)) msg VoiceBot VOICE $nick

Regex:
on *:JOIN:#: if ($regex(%nick,/^(Mr)?Magooba$/)) msg VoiceBot VOICE $nick

Userlevels:
on Magooba:JOIN:#: .msg VoiceBot VOICE $nick

/auser Magooba MrMagooba!*@*
/auser Magooba Magooba!*@*

or if you would prefer to use level number 523 for AutoVoice instead:

on =523:JOIN:#: .msg VoiceBot VOICE $nick

/auser 523 MrMagooba!*@*
/auser 523 Magooba!*@*


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard