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
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Sat Aug 03, 2002 9:23 pm   

Database Variables
 
Okay, I'm creating an automated scripting interface, and I want the user to be able to select a bunch of skills to work. Each skill will have a class folder with a bunch of Script Modules. Each skill has a database variable that looks like this:
Mod1 - Operable
Mod2 - Operable
Mod3 - Inoperable

These variables use the naming convention of SkillNameMods. At the beginning the user selects all the skills they want to use, and they're all added to a variable @PrimarySkills.
Now, before the script actually begins looking at which skills to work, I'd like it to check that the skills the user picked have at least 1 operable Module. I've created an alias:

CheckforWorkingMods:
#LOOP %numitems( @PrimarySkills) {
#VAR Checking %item( @PrimarySkills, %{i})
#VAR Operable 0
#LOOP %numitems( @{%concat( @Checking, "Mods")}) {
#IF (@{%concat( @Checking, "Mods")}.%concat( "Mod", "%{i}") =~ "Operable") {#VAR Operable 1}
}
#IF (@Operable = 0) {
#ECHO No @Checking Mods are available. It is being removed from the Primary Skills queue.
#DELITEM @PrimarySkills @Checking
}
}

My problem seems to like in the #IF statement which tries to check each key-value pair in a database variable to see if at least one of them is 'Operable'. Any suggestions would be greatly appreciated.

Belmyrddyn
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