|
Bromax Wanderer
Joined: 03 Jan 2002 Posts: 66
|
Posted: 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? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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}} |
|
|
|
|
|