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


Joined: 22 Jan 2009
Posts: 2

PostPosted: Mon Jan 26, 2009 9:12 pm   

Alias/variable assistance.
 
I just started using CMUD and I'm trying to get use to simple alias' and variables.

Right now I'm just trying to set up an alias and variable that will allow me to, for example if I was attacking a goblin, to type "t goblin" to set the target.

And then use a macro such as the 0 on my number pad to intiate and attack, like double slash for runewarden's in Achaea. I'm not sure how to set up the macro.

What I have currently is:

#VAR t %null
#ALIAS t {t=%1}

However, it seems that the alias is not allowing me to set the variable unless I type t=goblin.

From what I understood I was telling t to function as t=%1

I'm not certain why this isn't working.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Jan 26, 2009 9:49 pm   
 
I'm unable to duplicate this in 3.03a. I copied and pasted directly from your post to my command line and then did

t goblin
#show @t

and it showed "goblin".

Maybe there is a typo in your alias? Perhaps copy and paste the XML here?
Reply with quote
faulkner
Newbie


Joined: 22 Jan 2009
Posts: 2

PostPosted: Mon Jan 26, 2009 10:10 pm   
 
I'm currently using version 2.37, since I'm testing it out before buying.

Not certain why t goblin isn't working for me, but t=goblin works fine.

XML shows:

<var name="Target" id="16">#VAR t %null</var>


<alias name="Target" id="17">
<value>#ALIAS t {t=%1}</value>
</alias>
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Jan 26, 2009 10:28 pm   
 
Make sure Auto Append option is checked for your alias. You can read more about why it's needed at Aliases (Auto-append)
_________________
Asati di tempari!
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Jan 26, 2009 11:04 pm   
 
faulkner wrote:
<var name="Target" id="16">#VAR t %null</var>

Since you did not have an intention to make an inline function, quoted setting is wrong. You should assign a value to your variable, not an expression. And here you've written #VAR t %null expression - it is good for an alias, not to a variable.

faulkner wrote:
<alias name="Target" id="17">
<value>#ALIAS t {t=%1}</value>
</alias>

This alias would create another alias with t=%1 code.


In both settings you are trying to create another settings. But I think you need something simple like this:
Code:

  <var name="Target" id="1"/>
  <alias name="t" id="2">
    <value>Target = %params</value>
  </alias>


t goblin
#SAY @Target ---> will echo "goblin"
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Jan 26, 2009 11:26 pm   
 
To elaborate on what Arde said, the commands #var and #alias specifically CREATE variables and aliases. If you open up the settings editor and begin inputting things into your, for example, alias, you don't need to use the #alias command again because you've already created the alias (in the settings editor), instead you just need to input the commands you would like it to preform, in this case just
Code:
t = %1
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