 |
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Mon Jul 19, 2004 12:47 pm
Help please. |
I have a script that im haveing problems with.
It is a script that i use to tell me what kind of scrolls that they are with additional words.
Item 'a mildewed magenta scroll of 'summon elemental''
there are a few scrolls from a mud that i play on that wont work with this and im haveing problems trying to get it to work.
#1. there are some scrolls with the word scroll in the description of the scrolls.... and they dont show up at all.
Item 'a scroll made of rattlesnake skin'
#2. there is one scroll with a ' , ' in it which doesnt allow it to show up correctly ... which makes it look like
Item 'a soggy, yellow-green scroll of '''
What am i doing wrong? knowing my luck it would be something terribly simple that i am not seeing, What can i possibly do to fix this and Could you explain it please... I am still new at learning zmud and havent got enought experience in it to branch out on my own... please help me
| Code: |
#CLASS {Scrolls}
#VARIABLE Scrolls {Descriptionsan enchanted crimson-colored|a leopard skin|an icy silver|an unpleasant pink|a soggy, yellow-green|an enchanted emerald|a glossy lime|a frozen cherry colored|a damp white|an amber scroll made of cowhide|a midnight blue|a dirty ebony|a soggy blue|a teal rawhide|a silk magenta|a mauve colored cowhide|a cobalt blue|a ripped olive|a lustrous jade green|a llama hide|an indigo papyrus|a thick lambskin|an ebony cotton|an ebony colored icy|a copper-colored|a soiled red|a soggy cobalt|an indigo|a glazed crystal|a luminescent mother-of-pearl|a glowing powder blue|an off-white|a shimmering|a mauve|a faded green|a yellow cotton|a gold-leafed papyrus|a blue colored sable|a jet black cowhide|a glazed pink|a powder blue buckskin|an ivory|a verdant colored papyrus|a smelly metallic|a shimmering saffron|a transluscent amber|a silvery rawhide|an unpleasant-smelling silver|a beige|a glazed charcoal|a glossy yellow-green|a soiled blue|a transluscent|an icy azure|a moldy green|a tattered transparent|a dirty white|a shining fuchsia|an ecru spell scroll|a shimmering sapphire|a dragon hide|a brilliant sky-colored|a frosted translucent|a moth-eaten|a milky-white glowing|a weathered|a rose-colored cotton|a bronze-colored|a platinum-colored|a mystical ivory|an opalescent|a thin lambskin|a navy blue|a bewitching cerulean|a mandarin orange|a bewitching purple|a luminescent silver|a lime-green|a transluscent azure|a wrinkled gold|a swamp green|a brilliant amethyst|a crimson|a smeared green|a torn sandy|a shimmering crystalline|a burnt-sienna|a rattleskin|a sterling silver|an immaculate violet|a transluscent mother-of-pearl|a charcoal lambskin|a greasy aqua|a shining quartz|a moldy yellow|an enchanted vellum|a lightning blue|a smoky transparent|an antique ivory|a didactic|an enchanted onionskin|a gaudy granite|a charred cobalt|a wrinkled-gold|a brown scroll smelling of dung|a mildewed magenta|a musty black|a tainted teal|a glowing sorcerous|a faded antique|a dirty brown|an antique copper|an enchanted platinum|a smudged sticky|a thick parchment|a textured indigo|a tightly-wound|an inky blue|an ivory-yellow papyrus|a bedraggled|a translucent azure|a scroll made of rattlesnake skin|a crafted of llama hide|a sorcerous glowing|a glowing mother-of-pearl|a glowing crystalline|a smeared green spell|a glossy platinum|an ecru spell|a glazed coal-black|a tangerine spell|a translucent|a translucent mother-of-pearl|a soggy, yellow-green|a midnight-blueSpellsabjure|antimagic sphere|acid blast|animate dead|bless|awaken|armor|blink|call lightning|calm|cure light|light|chain lightning|change sex|charm|cause serious|chill touch|circle of fire|color spray|combat blink|control wheather|control winds|counterspell|create food|identify|fireball|create spring|create water|cure blindness|cure critical|cure disease|cause light|cure poison|cure serious|curse|death grip|detect alignment|detect illusion|detect invisibility|detect magic|dispel area|dispel magic|energy drain|enervation|enhanced strength|erase|faerie fire|farsight|find familiar|flame wind|frost|cause critical|gate travel|glamour|great shout|hands of wind|harm|haste|fountain|heal|icebolt|ice storm|ice whip|imprint aura|improved invisibility|infravision|invisibility|kill|levitation|lightning bolt|magic bomb|magic carpet|magic dart|magic lock|magic map|magic unlock|momentary darkness|nexus|pass door|paralyze|plague|plane travel|poison|poison gas|protection from evil|protection from good|recharge item|reflective fireball|refresh|remove curse|resurrect|reveal|room shield|sanctuary|sense-life|shield|shocking grasp|sleep|slow|spark|spell shield|stone skin|summon|summon creature|summon mount|summon elemental|swarm|teleport|thunderstorm|thunder clap|tremor|underwater breathing|warp|web|wizard eye|word of recall|weaken|silence|blindness|fireshield|pass door|reflective fireball|combat blink|thunderstorm|sanctify|reanimate|poison gas|warp|fountain|flame wind|circle of thorns|gate travel|resurrect|bless|cause light}
#VARIABLE ScrollSpell {%item( @Scrolls.Spells, %ismember( %1, @Scrolls.Descriptions))}
#TRIGGER {({@Scrolls.Descriptions}) scroll} {#SUBSTITUTE {%1" scroll of '"%ansi(12)@ScrollSpell(%1)%ansi(def)"'"}} "" {case|notrig}
#CLASS 0
|
|
|
|
|
 |
darmir Sorcerer

Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Mon Jul 19, 2004 1:20 pm |
Darkwytch,
Is the first example and example from the MUD?
To help us undstand a little better can you give an example of the MUD output then what you want your script to do. This way we can understand how it better. |
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Last edited by darmir on Mon Jul 19, 2004 1:47 pm; edited 1 time in total |
|
|
 |
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Mon Jul 19, 2004 1:44 pm |
no the first example is one from a scroll that works properly.. how i see it from the script that i have here pasted..
The other two are ones that dont work at all... basic line of text from the mud looks like so with out my trigger running.
Item 'an ivory scroll' is type scroll, alignment 0, made of paper, has keywords 'ivory spell scroll'.
This item weighs 0 stones and 5 pebbles, and is valued at 7,250 gp.This level 50 item has the attributes: identified nochange
An ivory scroll is in excellent condition.
Contains knowledge of the spell of 'dispel magic', scribed at level 50.
or like when i take it out of a container or item it looks like so..
You take an ivory scroll from a magical belt pouch.
but with the trigger turned on and running my scrolls should look like this,
Item 'an ivory scroll of ' dispel magic'' is type scroll, alignment 0, made of paper, has keywords 'ivory spell scroll'.
This item weighs 0 stones and 5 pebbles, and is valued at 7,250 gp.This level 50 item has the attributes: identified nochange
An ivory scroll is in excellent condition.
Contains knowledge of the spell of 'dispel magic', scribed at level 50.
You take an ivory scroll of ' dispel magic ' from a magical belt pouch.
and again most of them do work like this, except for the scrolls: a scroll made of rattlesnake skin , a brown scroll smelling of dung , and a soggy, yellow-green |
|
|
|
 |
darmir Sorcerer

Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Mon Jul 19, 2004 3:12 pm |
To me it looks like the two thing that are consistant in your Mud is the way it displays the item.
Make a trigger on "Item (*) is" and another on "You take (*) from"
Example untested:
| Code: |
#CLASS {ScrollAbrevs}
#VAR scrollabbrevs {an ivory scroll='dispel magic'|a mildewed magenta scroll='summon elemental'}
#TRIGGER {Item (*) is} {#IF (%iskey( @scrollabbrevs, %1)) {#sub {%concat(%1," of ",%ansi(12)%db(@scrollabbrevs,%1)}}}
#TRIGGER {You take (*) from} {#IF (%iskey( @scrollabbrevs, %1)) {#sub {%concat(%1," of ",%ansi(12)%db(@scrollabbrevs,%1)}}}
#CLASS 0
|
|
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Last edited by darmir on Thu Jul 22, 2004 8:38 pm; edited 2 times in total |
|
|
 |
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: Mon Jul 19, 2004 4:32 pm |
whos your char in MM, darkwytch?
|
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jul 19, 2004 5:13 pm |
For the first problem, include the word "scroll" in the description so that it will appear in the right place. Your trigger requires "scroll" to be the final word of the scroll description. It would also help to use the scroll descriptions as the keys of your record variable and the scroll spells as the values, instead of having "Description" and "Spells" as keys with matched lists for values.
The second problem is caused by the commas. Functions use commas to separate parameters, so whenever your string contains a comma it requires grouping characters to ensure that the functions will treat it as a single parameter. In particular, whenever you use %1 or %i in a function it should be enclosed in double-quotes or other delimiters.
#VAR Scroll2 {} {_nodef}
#ADDK Scroll2 {an enchanted crimson-colored scroll} {abjure}
#ADDK Scroll2 {a soggy, yellow-green scroll} {bless}
#ADDK Scroll2 {an amber scroll made of cowhide} {calm}
#TR {({@Scroll2})} {#SUB {%1 of '%ansi( hi,red)%db( @Scroll2, "%1")%ansi(def)'}} {Scrolls}
To simplify the switch from @Scrolls to @Scroll2, use this script:
#LOOP 1,%numitems( @Scrolls.Descriptions) {#IF %pos( scroll, %item( @Scrolls.Descriptions, %i)) {#ADDK Scroll2 {%item( @Scrolls.Descriptions, %i)} {%item( @Scrolls.Spells, %i)}} {#ADDK Scroll2 {%item( @Scrolls.Descriptions, %i) scroll} {%item( @Scrolls.Spells, %i)}}} |
|
_________________ 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. |
|
|
 |
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Tue Jul 20, 2004 12:44 am |
| Quote: |
#VAR Scroll2 {} {_nodef}
#ADDK Scroll2 {an enchanted crimson-colored scroll} {abjure}
#ADDK Scroll2 {a soggy, yellow-green scroll} {bless}
#ADDK Scroll2 {an amber scroll made of cowhide} {calm}
#TR {({@Scroll2})} {#SUB {%1 of '%ansi( hi,red)%db( @Scroll2, "%1")%ansi(def)'}} {Scrolls}
#LOOP 1,%numitems( @Scrolls.Descriptions) {#IF %pos( scroll, %item( @Scrolls.Descriptions, %i)) {#ADDK Scroll2 {%item( @Scrolls.Descriptions, %i)} {%item( @Scrolls.Spells, %i)}} {#ADDK Scroll2 {%item( @Scrolls.Descriptions, %i) scroll} {%item( @Scrolls.Spells, %i)}}}
|
AM i correct in assuming that If needed that i can add more scrolls into the @Scrolls2 string list if they make more like that or there are others like that? |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jul 20, 2004 2:49 am |
@Scroll2 is not a stringlist, it's a record variable. You can add as many key-value pairs as you want, using #ADDKEY. Each key must be unique, the values don't have to be.
|
|
_________________ 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. |
|
|
 |
|
|
|
|
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
|
|