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
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Mon Nov 12, 2001 2:17 am   

Nesting #IFs
 
Is it possible?

2nd place just means your a 1st place loser.
Reply with quote
Berion
Newbie


Joined: 10 Nov 2001
Posts: 8
Location: Norway

PostPosted: Mon Nov 12, 2001 2:51 am   
 
Yes it works fine. Just put the entire second #if between one of the {} of the first one.

It will look like this:

#if expression {what to do if true} {#if secondexpression {What to do if secondexpression is true} {What to do if secondexpression is false}}
Reply with quote
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Mon Nov 12, 2001 1:02 pm   
 
Ok, why doesn't this work?

#if (@locker = empty) {#if (@encumb = yes) {#slow locker} {#slow townmap}} {#slow Tradein}

2nd place just means your a 1st place loser.
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Nov 12, 2001 2:47 pm   
 
What do you mean by : #IF (@locker = empty)
If you are testing whether or not the variable contains data, then the correct syntax in this case would be: #IF (%null( @locker)) or #IF (@locker <> "").

And I think slowpaths are always preceded by a dot: #SLOW .locker (but I could be wrong).

Acaila
Reply with quote
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Mon Nov 12, 2001 4:04 pm   
 
Just so you know, I am collecting item I can sell. I fill my locker with them, then travel to a city where I can get the best value for them and sell them.

I am checking to see if my locker is full with a trigger. If it is I set the value of the varable LOCKER to FULL and if it is not full I set the value to EMPTY. As I complete a pass around my townmap, or if I become emcumbered and recall I end up in this room. I trigger this room to see if I need to keep walking, of if I need to unload in my locker (ie ENCUMB var) or if my locker is full, I go and sell all my stuff.
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Nov 12, 2001 4:35 pm   
 
Okay, my bad.

Your piece of code has nothing wrong with it then.
So, what isn't it doing?
- Does the trigger not fire?
- Do the variables not get filled with the values?
- Do you not walk a certain path when you should, or do all paths fail?

You could try turning the "show triggers" option on in Preferences|Script Parser to see what the problem is. Then just try out each possibility of your #IF function to see which one is malfunctioning.

Otherwise I have no idea, sorry.

Acaila
Reply with quote
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Mon Nov 12, 2001 9:18 pm   
 
As of this moment the @encumb = yes is true, but I keep walking the entire corse of the townmap instead of going to the locker.
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Mon Nov 12, 2001 10:04 pm   
 
Okay, that's just plain weird. I'm at a loss.

Anyone else got any suggestions?

Acaila
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Wed Nov 14, 2001 10:00 am   
 
Try using (@encumb = "yes") with the quotes. I think zMud is looking at yes as a true/false. I remember reading somewhere that 1,on,yes,true are all the same and 0,off,no,false are all the same.
Putting the "" around yes forces it to look for the literal string "yes", not a true/false condition.

I think that is the case. But I did get it it work with the "" around yes.

-Serentus-
Reply with quote
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Wed Nov 14, 2001 1:20 pm   
 
Smart Fellow you are... That was what it was. It was using the Yes as the key word. Thanks muches for your reply.
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