mIRC Homepage
Posted By: Renesue if-then-else statment - 11/12/05 09:08 PM
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
}
Posted By: NeUtRoN_StaR Re: if-then-else statment - 11/12/05 09:43 PM
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 
  } 
}

Posted By: Renesue Re: if-then-else statment - 11/12/05 10:29 PM
Oh, thank you! Light bulb moment for me! I wasn't bracketing correctly. :-/

Thanks again,

Renesue
© mIRC Discussion Forums