mIRC Home    About    Download    Register    News    Help

Topic Options
#137363 - 11/12/05 09:08 PM if-then-else statment
Renesue Offline
Bowl of petunias

Registered: 07/03/05
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
}

Top
#137364 - 11/12/05 09:43 PM Re: if-then-else statment
NeUtRoN_StaR Offline
Fjord artisan

Registered: 06/03/05
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 
  } 
}



Edited by NeUtRoN_StaR (11/12/05 09:46 PM)

Top
#137365 - 11/12/05 10:29 PM Re: if-then-else statment
Renesue Offline
Bowl of petunias

Registered: 07/03/05
Posts: 2
Oh, thank you! Light bulb moment for me! I wasn't bracketing correctly. :-/

Thanks again,

Renesue

Top