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
surge4883@yahoo.com
Beginner


Joined: 30 Jul 2010
Posts: 19

PostPosted: Sat Aug 07, 2010 8:51 pm   

nested if statements
 
I am having an issue getting this trigger to function correctly. I have a tarot card and I want the first card drawn to be the Hanged man, either reversed or regular.


You flip the first tarot card, revealing The Hanged Man (reversed).
You flip the first tarot card, revealing The Hanged Man.



#TRIGGER {You flip the first tarot card, revealing (*).} {#IF (%1 <> "The Hanged Man") {#IF (%1 <> "The Hanged Man ~(reversed~)") {tarot shuffle} {#ECHO The Hanged Man located!}} {#ECHO The Hanged Man located!}}

The hanged man comes up and it shuffles the deck anyway... what am I doing wrong here?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Aug 07, 2010 9:58 pm   
 
#if (%ismember("%1","The Hanged Man|The Hanged Man ~(reversed~)") {#echo...} {tarot shuffle}

%1 without the quotes was probably being evaluated as some phrase <> "The Hanged Man" which in turn would get evaluated to some 0 and that would then evaluate to 1 (ie, True).
_________________
EDIT: I didn't like my old signature
Reply with quote
surge4883@yahoo.com
Beginner


Joined: 30 Jul 2010
Posts: 19

PostPosted: Sat Aug 07, 2010 10:01 pm   
 
Once I get this to work, the next issue is I have a list of about 12 cards I want to keep my eye out for. I have them all stored in a stringlist, but how do I make a trigger to match items in the string list

You flip the (*) tarot card, revealing (insert card name here) It should check the card name and see if it is on the list of good cards. If the card is a normal one, it continues to draw, it should stop drawing when a good card is pulled.

How do you trigger when part of the pattern to be matched is inside of a variable?
Reply with quote
surge4883@yahoo.com
Beginner


Joined: 30 Jul 2010
Posts: 19

PostPosted: Sat Aug 07, 2010 10:06 pm   
 
I tried using the ismember idea you gave me, but it is saying syntax error under the {#echo The hanged man located!}

#if (%ismember("%1","The Hanged Man|The Hanged Man ~(reversed~)") {#echo The Hanged Man located!} {tarot shuffle}
Reply with quote
surge4883@yahoo.com
Beginner


Joined: 30 Jul 2010
Posts: 19

PostPosted: Sat Aug 07, 2010 10:08 pm   
 
oh nvm I found the error... There needs to be a second ) before the {#echo
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