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
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Sun Jun 24, 2007 11:20 pm   

%if question
 
Hey,

Code:
#show %format( " &-15s &3.0n", "Blank Needed", %if( !%iskey( @my_cards, nothing)), %db( @my_cards_maximum, nothing), %db( @my_cards_needed, nothing))


It should display the maximum needed (100) as set by the database if I have none, or set the amount needed if I do have some, which is set in the cards_needed database.

I haven't played enough with %if and %format though in order to solve this and it's irking my brain. If anyone could solve this one for me I would appreciate it.

This is what happens now.

Quote:

Combat:
Aeon 100 0
Death 10 90
Devil 100 0
Empress 38 62
Emperor 6 94
Hangedman 20 80
Hierophant 9 91
Justice 10 90
Lovers 10 90
Lust 16 84
Moon 100 0
Star 100 0

Healing:
Fool 100 0
HighPriestess 100 0
Magician 100 0

Utility:
Chariot 10 90
Creator 10 90
Hermit 8 92
Tower 79 21
Universe 100 0

Miscellaneous:


This is what should happen.


Quote:

Combat:
Aeon 100 0
Death 10 90
Devil 100 0
Empress 38 62
Emperor 6 94
Hangedman 20 80
Hierophant 9 91
Justice 10 90
Lovers 10 90
Lust 16 84
Moon 100 0
Star 100 0

Healing:
Fool 100 0
HighPriestess 100 0
Magician 100 0

Utility:
Chariot 10 90
Creator 10 90
Hermit 8 92
Tower 79 21
Universe 100 0

Miscellaneous:
Blank Needed 100


Assuming I had no blanks cards at all. Or it should display how many is needed depending on how many I have.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Jun 25, 2007 3:57 am   
 
Please edit your post to use [ code ] [ /code] tags instead of quote tags to preserve formating.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Jun 25, 2007 11:01 am   
 
Your %if function seems to be just this:

%if( !%iskey( @my_cards, nothing))

Did you add one too many brackets to the end there and one too few at the very end of the #show command?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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