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
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Sun Feb 21, 2010 6:39 am   

Need some help
 
Made this trigger, however it doesn't seem to be capturing the #add properly. Any help would be great!

Code:
#CLASS {reagrent}
#ALIAS rbag {open 5.bag;get all 5.bag;close 5.bag}
#ALIAS reagch {l in 1.silk;#wait 500;l in 2.silk;#wait 500;l in 3.silk;#wait 500;l in 4.silk;#wait 500}
#ALIAS rbuy {reagch;shop buy @airreagneed roc;put all.roc 3.silk;shop buy @waterreagneed scale;put all.scale 4.silk;shop buy @firereagneed sulfur;put all 1.silk;shop buy @mandrakeneed mandrake;put all.leaf 2.silk}
#VAR crystal {}
#VAR admantite {}
#VAR copper {}
#VAR obsidian {}
#VAR platinum {}
#VAR golden {}
#VAR airreagneed {0}
#VAR waterreagneed {0}
#VAR sulfneed {0}
#VAR mandrakeneed {9}
#VAR waterreagbuyfull {0}
#VAR waterreagneednotfull {0}
#VAR sulfbuyfull {3}
#VAR sulfneednotfull {7}
#VAR airreagbuyfull {5}
#VAR airreagneednotfull {3}
#VAR mandrakebuyfull {4}
#VAR mandrakeneednotfull {19}
#TRIGGER {^Your Vandemaar's Reagent Bag glows white as it accumulates possessions from the ether} {rbag}
#TRIGGER {You take a mandrake leaf from Vandemaar's Reagent Bag.} {put all.leaf 2.silk;#add @earth+%1}
#TRIGGER {You take (%1) of a mandrake leaf from Vandemaar's Reagent Bag.} {#add @earth+%1;put all.leaf 2.silk}
#TRIGGER {You take a shimmering white fish scale from Vandemaar's Reagent Bag.} {#add @water+1;put all.scale 4.silk}
#TRIGGER {You take (%1) of a shimmering white fish scale from Vandemaar's Reagent Bag.} {#add @water+%1;put all.scale 4.silk}
#TRIGGER {You take a silver runestone from Vandemaar's Reagent Bag.} {#add @gem+1;put all.rune 2.trunk}
#TRIGGER {You take (%1) of a silver runestone from Vandemaar's Reagent Bag.} {#add @gem+%1;put all.rune 2.trunk}
#TRIGGER {You take a sunstone from Vandemaar's Reagent Bag.} {#add @eth+1;put all.sun trunk}
#TRIGGER {You take (%1) of a sunstone from Vandemaar's Reagent Bag.} {#add @eth+%1;put all.sun trunk}
#TRIGGER {You take a feather from a roc from Vandemaar's Reagent Bag.} {#add @air+1;put all.fea 3.silk}
#TRIGGER {You take (%1) of a feather from a roc from Vandemaar's Reagent Bag.} {put all.fea 3.silk;#Add @air+1}
#TRIGGER {You take (%1) of a pinch of sulfur from Vandemaar's Reagent Bag.} {put all.sul 1.silk;#ADD @fire %1}
#TRIGGER {You take a pinch of sulfur from Vandemaar's Reagent Bag.} {put all.sul 1.silk;#Add @fire+1}
#TRIGGER {You aren't carrying anything that will fit into a yellow silk bag.} {drop all.roc}
#TRIGGER {You aren't carrying anything that will fit into a red silk bag.} {drop all.sulfur}
#TRIGGER {You aren't carrying anything that will fit into a blue silk bag.} {drop all.scale}
#TRIGGER {You aren't carrying anything that will fit into a black silk bag.} {drop all.mandrake}
#TRIGGER {You aren't carrying anything that will fit into Vandemaar's Trunk.} {drop all.reag}
#TRIGGER {~((%d)~) a feather from a roc} {#var air %1;#var airreagneed 0;#if (air = 250) {#abort} {#math airreagneed (250-@air)}}
#TRIGGER {~((%d)~) a shimmering white fish scale} {#var water %1;#var waterreagneed 0;#if (water = 250) {#abort} {#math waterreagneed (250-@water)}}
#TRIGGER {~((%d)~) a pinch of sulfur} {#var fire %1;#var sulfneed 0;#if (fire = 250) {#abort} {#math sulfneed (250-@fire)}}
#TRIGGER {~((%d)~) a browning mandrake leaf} {#var earth %1;#var mandrakeneed 0;#if (earth = 250) {#abort} {#math mandrakeneed (250-@earth)}}
#TRIGGER {feather from a roc*brightly and vanish!} {#ADD @air -1}
#TRIGGER {sunstone*brightly and vanish!} {#ADD @eth -1}
#TRIGGER {browning mandrake leaf*brightly and vanish!} {#ADD @earth -1}
#TRIGGER {shimmering white fish scale*brightly and vanish!} {#ADD @water -1}
#TRIGGER {runestone*brightly and vanish!} {#ADD @gem -1}
#TRIGGER {pinch of sulfur*brightly and vanish!} {#ADD @fire -1}
#TRIGGER {You take a silver runestone from Vandemaar's Reagent Bag.} {put all.rune 2.trunk;#Add @gem+1}
#TRIGGER {You take (%d) of a silver runestone from Vandemaar's Reagent Bag.} {put all.rune 2.trunk;#add @gem+%1}
#TRIGGER {You take a sunstone from Vandemaar's Reagent Bag.} {put all.sun 1.trunk;#add @eth+1}
#TRIGGER {You take (%d) of a sunstone from Vandemaar's Reagent Bag.} {put all.sun 1.trunk;#add @eth+%1}
#BUTTON 4 {@earth Earth Reags} {} {} {} {@earth} {} {} {} {} {} {} {} {} {32} {} {Gauge||10|250|100|15} {} "" {Explore|Inset} {} {} {4}
#BUTTON 5 {@air Air Reags} {} {} {} {@air} {} {} {} {} {} {} {} {} {96} {} {Gauge||14|250|100|15} {} "" {Explore|Inset} {} {} {4}
#BUTTON 6 {@fire Fire Reags} {} {} {} {@fire} {} {} {} {} {} {} {} {} {64} {} {Gauge||12|250|100|15} {} "" {Explore|Inset} {} {} {4}
#BUTTON 7 {@water Water Reags} {} {} {} {@water} {} {} {} {} {} {} {} {} {16} {} {Gauge||9|250|100|15} {} "" {Explore|Inset} {} {} {4}
#BUTTON 8 {@eth Eth Reags} {} {} {} {@eth} {} {} {} {} {} {} {} {} {80} {} {Gauge||13|50|25|15} {} "" {Explore|Inset} {} {} {4}
#BUTTON 9 {@gem Gem Reags} {} {} {} {@gem} {} {} {} {} {} {} {} {} {48} {} {Gauge||11|50|25|15} {} "" {Explore|Inset} {} {} {4}
#CLASS 0
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 21, 2010 7:11 am   
 
When something goes wrong, first check your syntax. You can do this by placing the cursor on the command or function that is not working as you expect it to and pressing F1.

#ADD varname amount-to-modify

example:
#add earth 5
#add earth -2
_________________
EDIT: I didn't like my old signature
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Sun Feb 21, 2010 7:27 am   
 
Got all but the gem and eth triggers working, for some reason it just doesn't want to add them properly =/
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 21, 2010 7:59 am   
 
Whenever you want to refer to the contents of a variable instead of to the variable itself, use @ in front of the varname:

#if (@earth = 250) {...}
#if (%isnumber(@earth)) {...}

#var earth 1
earth = 1
#add earth 1

Of course, there are a few exceptions such as %pop() and %push().
_________________
EDIT: I didn't like my old signature
Reply with quote
Alexiel
Novice


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Sun Feb 21, 2010 9:46 pm   
 
Yeah, its still not working how I want it too.
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