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
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Mon Dec 10, 2001 9:03 pm   

Dealing w/ multiple params in a Variable
 
I have a variable list with two params in it, for each item. I have several of these, and I would like to setup and alias to run a function, to check the second parameter in the variable and if the condition does not exist, do someinthing with the first parameter.

Example:


@Vspstones= {97772|1|97703|1|18213|1|99729|1|99723|1|13119|1|19510|1|98793|1|67048|0|50111|0|5988|0|88638|0}

@Vpstones= {35721|1|56752|1}


so I want to set up and alias to test for condition 0 as it exists in vspstones, on stonetype 67048, if I dont have it, I want it to buy 67048. Also, I would like the same alias to work for either @vspstones, or @vpstones.
So I figure I I would have to sub out @v%1 somehow and add in the @v to the name So If the Alias was named BS I could type in BS spstones from person
and it would Add in the @v to the %1 and buy it from %2, but I dont know how to run the tests for the 0, I'd assume a #forall is the likely culprit, but I have yet to figure out how to use this frisky critter. If someone would be so kind as to give me a bit of help, AND IF #forall is used, give me a brief explaination of what it is doing, I would appreciate the tutoring on that particular piece of zmud script as I know it is a very powerful command within the language.

Thanks a bunch guys,
-Shyl-
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Mon Dec 10, 2001 9:42 pm   
 
instead of a string list, you could try useing a database variable.
name each key with the stones id number, and have the value of the key be 1 or 0
something like:

#var vspstone ""
#addkey vspstone a97772 1 //need an "a" to conform to var name rules
#addkey vspstone a97703 1
#addkey vspstone a18213 1
etc.

would do the trick
then you could test like this:

#if @vspstone.a97703 {} {buy 97703}

Emit
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