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
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Sun Jan 24, 2010 5:56 am   

need help with a IF NOT situation
 
I have a simple target variable =
@target

I have also alias like this =
#alias go "shadowstep %1"

I would like to make something like this =
#alias go "shadowstep %if{%1}{@target}"
or something like that?

If %1 is not there substitute with target.

If some one Could help me with that, It would be great thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jan 24, 2010 6:07 am   
 
you're on the right track, just using bad syntax in the %if() function:

shadowstep %if(%null(%1),@target,%1)

To take it a step further, you can also check on @target:
Code:
#switch ((@target = "") and %null(%1)) {#print HEY, WAIT! YOU DIDN'T PROVIDE A TARGET!}
  (!%null(%1)) {shadowstep %1}
  (1) {shadowstep @target}
_________________
EDIT: I didn't like my old signature
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