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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Feb 06, 2009 4:16 pm   

if and variables
 
Ok lets say i got 3 variables @one @two and you guessed it @three
how do i make the following work

at the moment i have triggers that will add items to @one @two as things happen

alias GO
IF @one (has a value in a stringlist - say hi - however if it has nothing entered into the list eg blank say bye)

ultimately I want to
look at @one (if value - take action) (if blank look at @two) (if value - take action) (if blank look at @three) (if value - take action) if blank do final action
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Fri Feb 06, 2009 4:29 pm   
 
You mention a stringlist for the variables. Is what you are looking for something that can be contained within the string lists, or just if there is anything in the list at all?
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Feb 06, 2009 4:41 pm   
 
just if it has anything eg
you find an egg
tr additem @one egg etc etc so @one becomes egg:duck:curry etc etc

so then when i use the alias above GO
IF @one (egg:duck:curry) smile
IF @one (empty) frown
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Feb 06, 2009 4:50 pm   
 
so to use above examples
IF @one (egg:duck) get duck, if @one (empty - no value) check @two
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Fri Feb 06, 2009 5:11 pm   
 
Doh if only I read more - i guess it is %null
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Feb 06, 2009 5:43 pm   
 
Your question seems a bit confused--each of your message is looking for a different result. For your first question, you are looking for something like this:
Code:

#if (@one) {say hi} {say bye}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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