Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Bromax
Wanderer


Joined: 03 Jan 2002
Posts: 66

PostPosted: Mon Jun 07, 2004 6:37 am   

Little #if that wouldn't....
 
Got a script for keeping track of time on my mud:

#ADD currenttime 1
#IF ((@currenttime=12) AND (@mornnight = am)) {mornnight pm}
#IF ((@currenttime=12) AND (@mornnight = pm)) {mornnight am}
#IF (@currenttime=13) {currenttime 1}

Only problem is that it will change from am to pm, but then it will not change back. If I switch the am and pm's then I have the opposite problem...what did I do wrong with this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jun 07, 2004 7:23 am   
 
If @currenttime = 12 and @mornnight = am.
#IF ((@currenttime=12) AND (@mornnight = am)) {mornnight pm}
Presumably mornnight is an alias which will change the value of @mornnight, so now @currenttime will still be 12 but @mornnight will be pm.
#IF ((@currenttime=12) AND (@mornnight = pm)) {mornnight am}
Now @mornnight will be am, regardless of which value it had to start.

Replace both #IF statements with one nested #IF statement.
#IF (@currenttime = 12) {#IF (@mornnight = am) {mornnight pm} {mornnight am}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net