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
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Sat Oct 02, 2010 1:23 am   

Expanding #WALK from an alias
 
I have started updating all of my "auto" scripts with the sellScript style, but I hit a snag with questLocations

I have a string with a list of locations, and a database record with their command, when the quest master tells me where the quest is, my script is supposed to quest up the locations, then send it to the mud, but its having trouble.

Code:

<alias name="emptyQuestQueue" enabled="false" id="91">
  <value>#if (@locationQueue) {
%pop({locationQueue})
}
#t- matchLocation</value>
</alias>


the values in @locationQueue are always in this format

#WALK 1234

Right now everything is fine until the pop command, at that point nothing happens. At first i did not have the {} around the locationQueue alias, but that did not seem to do the trick, any thoughts?
_________________
<Clever text here>
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Oct 04, 2010 1:07 pm   
 
You cannot start a command line with a function (%functionname) or variable (@variablename). You must start the command line with a Cmud command or an alias. In this case, what you want is:
#EXEC %pop(@locationQueue)

An even better method would be to simply have the room number in your database variable, and use:
#WALK %pop(@locationQueue)
Reply with quote
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Mon Oct 04, 2010 1:49 pm   
 
Quote:
You cannot start a command line with a function (%functionname) or variable (@variablename).


Totally spaced that fact, thank you Rahab.[/quote]
_________________
<Clever text here>
Reply with quote
Tech
GURU


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

PostPosted: Mon Oct 04, 2010 4:37 pm   
 
The syntax for the %pop function is simply "%pop(listname)". For example:
Code:
List="a"|"b"|"c"
#SHOW %pop(List)


If this isn't what you mean then we'll need to see more of your script, and the value of locationQueue when you run into a problem.

[Edit]And this one as well apparently. Shocked
_________________
Asati di tempari!
Reply with quote
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Mon Oct 04, 2010 5:29 pm   
 
#WALK %pop(@locationQueue) worked perfectly. Rahab was dead on with my error. Laughing
_________________
<Clever text here>
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