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
Nickman
Beginner


Joined: 26 Feb 2003
Posts: 15

PostPosted: Thu Dec 02, 2004 7:18 pm   

I need help in scripts
 
Hi all

I was trying to make a trigger to automate in a way the process to enhance an item.

#CLASS {Enhance Test}
#TRIGGER {A (%w) skinned from Ruiners Zmud Gag. begins to hum softly!} {#IF ("%2" = "Magic pulses through A Cloak skinned from Ruiners Zmud Gag., blessing it with fortune.") {sell %1} {Cast 'Solidify' %1}}
#TRIGGER {You buy A (%w) skinned from Ruiners Zmud Gag. for 300 gold.} {Cast 'Resonate' %1}
#TRIGGER {You solidify A (%w) skinned from Ruiners Zmud Gag. making it visible again.} {#IF ("%2" = "Magic pulses through A Cloak skinned from Ruiners Zmud Gag., enhancing its power.") {sell %1} {cast 'Illuminate' %1}}
#CLASS 0

The problem is that at any case the trigger always casting the spell(s) without checking the procedure first. The strange is that im using a very similar trigger to create other items and the whole procedure is working perfectly. Can anyone give me any advice pls?
_________________
Hey doc how was the surgery? ..Hhmm surgery? i thought it was Necropsy
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Dec 02, 2004 7:23 pm   
 
What are you checking %2 against? The if statements are not going to work unless you checking against %2.

Read the bottom of Pattern Matching in the help file.
Code:

(pattern)   save the matched pattern in a parameter %1 though %99


If in your trigger you had something like this:
A (%w) skinned from (%w), begins to hum softly.
Then the %2 checks against the second %w.

Can you give us an example of your MUD output so we can help you 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 Thu Dec 02, 2004 7:41 pm; edited 1 time in total
Reply with quote
Nickman
Beginner


Joined: 26 Feb 2003
Posts: 15

PostPosted: Thu Dec 02, 2004 7:39 pm   
 
The first and working script (but for a different purpose) is the following

#CLASS {Skin Test}
#VAR skinns {boots|leggings|sleeves|cloak|gloves|helm}
#VAR Statters {intelligenceluckwisdomstrengthdexterityconstitution}
#TRIGGER {You fail to preserve %w (%w) skinned from} {preserve %1}
#TRIGGER {You make yourself %w (%w) skinned from *.$(*)} {#IF ("%2" = "If you want to keep this item, don't forget to 'preserve' it.") {drop %1} {preserve %1}}
#TRIGGER {You receive * experience points.} {skin %item( @skinns, %random( 1, 6)) corpse}
#CLASS 0

and based to that i was trying to make the first script that i posted.

The mud output is the following

You buy A Cloak skinned from Ruiners Zmud Gag. for 300 gold.
(casting resonate)
A Cloak skinned from Ruiners Zmud Gag. begins to hum softly!
Magic pulses through A Cloak skinned from Ruiners Zmud Gag., blessing it with fortune. (this is the output if the item gets any bonus)

(casting solidify)
You solidify A Cloak skinned from Ruiners Zmud Gag. making it visible again.
Magic pulses through A Cloak skinned from Ruiners Zmud Gag., enhancing its power. (this is the output if the item gets any bonus)
_________________
Hey doc how was the surgery? ..Hhmm surgery? i thought it was Necropsy
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Dec 02, 2004 7:46 pm   
 
See my above edited post. You aren't checking against %2 correctly. Where does this "Magic pulses through A Cloak skinned from Ruiners Zmud Gag., blessing it with fortune. " in your MUD output?
_________________
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)
Reply with quote
Nickman
Beginner


Joined: 26 Feb 2003
Posts: 15

PostPosted: Thu Dec 02, 2004 8:06 pm   
 
Ohh i got the point. I have only one (%w) and for that reason i just changed the "%2" to "%1" but unfortunately i got the same result.
That output is the second line after the "A Cloak skinned from Ruiners Zmud Gag. begins to hum softly!"
_________________
Hey doc how was the surgery? ..Hhmm surgery? i thought it was Necropsy
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Fri Dec 03, 2004 12:12 pm   
 
This should do it for you:
Code:

#CLASS {Enhance Test}
#VAR item {cloak}
#TRIGGER {A (%w) skinned from Ruiners Zmud Gag. begins to hum softly!} {#var item %1}
#COND {(*)} {#IF (%1 = "Magic pulses through A Cloak skinned from Ruiners Zmud Gag., blessing it with fortune.") {sell @item} {Cast 'Solidify' @item}}
#TRIGGER {You buy A (%w) skinned from Ruiners Zmud Gag. for 300 gold.} {Cast 'Resonate' %1}
#TRIGGER {You solidify A (%w) skinned from Ruiners Zmud Gag. making it visible again.} {#var item %1
 {sell %1} {cast 'Illuminate' %1}}
#COND {(*)} {#IF ("%1" = "Magic pulses through A Cloak skinned from Ruiners Zmud Gag., enhancing its power.") {sell @item} {Cast 'Illuminate' @item}}
#CLASS 0


Have fun
_________________
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)
Reply with quote
Nickman
Beginner


Joined: 26 Feb 2003
Posts: 15

PostPosted: Fri Dec 03, 2004 9:31 pm   
 
Thank you very much for your help and your time Smile
_________________
Hey doc how was the surgery? ..Hhmm surgery? i thought it was Necropsy
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