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
Shogi
Newbie


Joined: 05 Mar 2008
Posts: 3

PostPosted: Wed Mar 05, 2008 7:35 pm   

Help with expressions
 
Hi, I was hoping someone could help me with an issue.

Assume a predefined variable named: @Target
The first two show statements are just for testing purposes.

I want if I type 'fire x' for it to pass the x on to the Target variable
If I type 'fire' it just uses the pre-deffinition. I'm pretty sure the error revolves around the '!' parameter in the first statement. But I don't know what I'm doing wrong. Any helpful suggestions would be appreciated.

Code:
#IF (%1="!%null") {#VAR Target %1}
#VAR Casting 1
#VAR Recast {flame strike}
#SHOW {Target='@Target'}
#SHOW {Variable='%1'}
#CLASS SpellResolve 1
#IF (@Energi=0) {
  #SE embrace
  #WAIT
  }
#SHOW {[Casting: Flame Strike]}
#COLOR 14
#SE {channel 'flame strike' @Target}
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Mar 05, 2008 7:47 pm   
 
You shouldn't put %null in quotes, and you shouldn't put the ! inside them either. You want (%1 != %null) or (%1 = !%null). However, you mean "If %1 has a value", so you should just use #if (%1).
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Shogi
Newbie


Joined: 05 Mar 2008
Posts: 3

PostPosted: Wed Mar 05, 2008 8:18 pm   
 
Thanks for the quick reply. That fixed it. I feel like an idiot now.
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