skip navigation

Welcome, Guest [log in · register]
Cwn Annwn
Search
Page 1 of 1 1
Alexiel The variables do not seem to want to add up properly, its driving me nuts. Any help would be fantastic.

#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.leaf}
#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
Tejon
Avatar
I’ll point out that this script is actually illegal, because you are triggering directly off the Vandy bag ‘collects from the ether’ string. If you remove that, it looks legal to me, and you can just run ‘rbag’ manually now and then.

The technological problem looks to be you use of #add. Use it like so:
#add fire 1

Notice there is no @ sign and no + sign.

Tejon
Alexiel Tried it that way, its still setting up seperate variables ie: 27+1 instead of going into the earth,air,water,ect ones.
Tejon
Avatar
You have a few other problems that interact with ZMud’s fiddly and intermitently just unreliable syntax. Things to note/fix:
- The test for equality inside the #if should be done with ‘==’ not ‘=’.
- In the trigger expression that captures numbers of reagents, don’t use (%1), use (&tmp) or some such. It is more reliable. It shouldn’t be, but it is.
- Only use @FOO when you want the contents of FOO, not when you want the variable FOO.
- At points you use %1 when you likely mean to use 1.
- You’ll want to set the class property on your reagrent [sic] class to ‘Set as Default when executing’. That will keep copies of variables from being littered all over, depending on what else happens to be executing.
- Never EVER "drop all.keyword" via script. You will screw yourself somehow. You can "drop all.’short name of item’" much more safely.
- If you’re getting variables with names like ‘27+1’ you are definitely doing #add @fire+1 when you mean #add fire 1.
- If you really want a well-tested reagent purchasing script, see me in game.

Tejon
Page 1 of 1 1