mIRC Home    About    Download    Register    News    Help

Print Thread
if-then-else statment #137363 11/12/05 09:08 PM
Joined: Mar 2005
Posts: 2
R
Renesue Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Mar 2005
Posts: 2
The following script should execute the first 3 lines if Monkeyboy joins on 12/11/2005, else it should execeute all the rest of the lines, the lines from ELSE onward. What actually happens on 12/11/2005 is that it executes ALL the lines, not just the first 3 lines. I'd appreciate any help fixing this script. I'm just a beginner scripter, so I'm sure I've totally bunged it up somewhere!

on @Monkeyboy:join:#mychannel:{
if ($adate == 12/11/2005) /msg $chan Happy birthday, $nick $+ !
if ($adate == 12/11/2005) /sound $chan Birthday.wav
if ($adate == 12/11/2005) /mode #mychannel +v $nick
else /mode #mychannel +v $nick | msg #mychannel Greetings, $nick $+ ! =) Nice to see you! =) | /sound $chan xmSLEIGHBELLS2.wav
mode #mychannel +v $nick
notice $nick Type !rules for a copy of the channel rules.
notice $nick Type !help for a list of all my commands
/whois $nick $nick
}

Re: if-then-else statment #137364 11/12/05 09:43 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Code:
on @Monkeyboy:join:#mychannel:{
  if ($adate == 12/11/2005) {
    msg $chan Happy birthday, $nick $+ !
    sound $chan Birthday.wav
    mode $chan +v $nick
  }
  else { 
    mode $chan +v $nick
    msg $chan Greetings, $nick $+ ! =) Nice to see you! =)
    sound $chan xmSLEIGHBELLS2.wav
    mode $chan +v $nick
    notice $nick Type !rules for a copy of the channel rules.
    notice $nick Type !help for a list of all my commands
    whois $nick 
  } 
}


Last edited by NeUtRoN_StaR; 11/12/05 09:46 PM.
Re: if-then-else statment #137365 11/12/05 10:29 PM
Joined: Mar 2005
Posts: 2
R
Renesue Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Mar 2005
Posts: 2
Oh, thank you! Light bulb moment for me! I wasn't bracketing correctly. :-/

Thanks again,

Renesue