|
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Tue Aug 31, 2004 3:31 pm
A herbal mixture identifier Script im trying to build. |
Hello, I am trying to make a script that will read the Herbal Mixture from this trigger,
a dark red herbal mixture
I am trying to make it gather the name of the Mixture, and the Mixture Power. Like this for example.
a dark red herbal mixture 'sense-life 71-85'
this is what I have worked out so far.
#VARIABLE MixturesID {a silvery|a reddish|a light blue|a dark purple|a glimmering white|a warm brown|a pale blue|a dark red|a faint yellow|a bright green|a shimmering copper|a sticky magenta|a sparkling gold|a bright yellow|a warm blue|a malevolent magenta|a glittering black|a pulsating orange}
#VARIABLE MixtureInfo { %item (@MixturesID)%item @MixturesAffects, %item @MixturePowers)}
#VARIABLE MixturePowers {1-10|11-20|21-30|31-40|41-50|51-60|61-70|71-85|86-105|106-115|116-135|136-145|146-155|156-170|171-185|186-200|201-220|221-686}
#VARIABLE MixturesAffects {awaken|cause light|detect invisibility|reveal|cure light|refresh|sense-life|calm|cure poison|blind|deathgrip|fatigue|cure disease|charm|flame wind|high explosive|magic bomb}
#TRIGGER { herbal mixture ({@Mixture})} {#SUBSTITUTE {%1" herbal mixture of '"%ansi(12)@MixtureInfo%ansi(def)"'"}} "" {case|notrig}
I cannot figure out what it is im doing wrong.. Could you tell me please... I tried looking up the %ismember function and %item function and it gives only a couple of examples so I didnt really know what it was I could do with them. I even got an idea to try the %if function. but I guess I didnt do it right because it wasnt working on my mud. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Tue Aug 31, 2004 4:48 pm |
I don't understand how your getting power level but looking over your script I can tell your using %item incorrectly.... And also your variables don't match up dark red(8 in mixture id) = calm (8 in Mixture affect).
After sorting out your MixturesAffects and MixturePowers and MixturesID Vars here are the changes
#UNVAR MixtureInfo
#FUNC MixtureInfo {%ansi( 12)%item( @mixturesAffects, %1) %item( @MixturePowers, %1)}
#TRIGGER {(*) herbal mixture} {#SUBSTITUTE {%1 herbal mixture of @MixtureInfo(%ismember( %lower("%1"), @MixturesID))}} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Sep 01, 2004 10:49 pm |
I would suggest using record variables. These are easier than matched list variables because the information is always correctly paired up. You can either use two variables, one for affects and the other for powers, or a single variable with both the affect and power included in the key as a list.
Two variables
#ADDK MixPower {a dark red} {71-85}
#ADDK MixAffect {a dark red} {sense life}
#TR {({@MixAffect}) herbal mixture} {#SUB {%1 herbal mixture of '%ansi( hi, red)%db( @MixAffect, %1) %db( @MixPower, %1)%ansi(def)'}} "" {case|notrig}
One variable
#ADDK Mixtures {a dark red} {sense life|71-85}
#TR {({@Mixtures}) herbal mixture} {#SUB {%1 herbal mixture of '%ansi( hi, red)%item( %db( @Mixtures, %1), 1) %item( %db( @Mixtures, %1), 2)%ansi(def)'}} "" {case|notrig} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|