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
vortis
Novice


Joined: 15 Jul 2010
Posts: 39
Location: USA

PostPosted: Fri May 08, 2015 3:23 am   

SOLVED: How to hold a command within a variable and then execute it later
 
So I have been playing with the #PICK command as such:

#PICK {p:Select Item:}
{*Arrow:CM_Arrow}
{Medium:CM_Branch_M}
{Large:CM_Branch_L}

and I set CM_Arrow as a multiline Alias:
CM_Choice="CM_Arrow"
carve weapon arrow

and when the item is finished I have a trigger:
Pattern: You craft an arrow!

Trigger:
#IF (@AutoCraft=1) {
CM_Choice
}

The trigger sends "CM_Arrow" to the MUD, which isn't a local command and fails to do anything, because CM_Arrow is a client-side alias inside CMUD. I want the alias to fire, not send the name of the alias to the MUD. Is there an easy way to fire the contents of CM_Arrow from the trigger or is there a better way to go about this?
Basically what I am trying to do, is to simply repeat the actions I chose from the popup #PICK menu, rather than simply go through the entire menu again to pick the same item (I simplified this as I have 5 menu categories, each with multiple options)


Last edited by vortis on Fri May 08, 2015 5:18 am; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Fri May 08, 2015 3:28 am   
 
try #EXEC CM_Arrow
_________________
Discord: Shalimarwildcat
Reply with quote
vortis
Novice


Joined: 15 Jul 2010
Posts: 39
Location: USA

PostPosted: Fri May 08, 2015 5:18 am   
 
shalimar wrote:
try #EXEC CM_Arrow


Thanks, that's exactly what I was searching for.
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