Hey everyone! I'm somewhat new to ash scripting. I've made some scripts for mafia before... but they all exclusively used "cli_execute" before it did anything. This is my first attempt to use ash commands, as well as make the script think for itself a little.
This script is designed to get me through the sewer, and only the sewer. First it gets the items to make the run as short as possible. Then it equips the outfit, mood, and familiar I want. Then it adventures in the sewers. Then it takes the items dropped and does stuff with them. And finally it switches back to my standard outfit, mood, and familiar. Here's what I have so far:
After spending a great deal of time debugging, I've run into a problem that I don't know how to solve. I keep getting the following error:
"Unknown variable 'if' (Sewer.ash, line 45)"
I have no idea what this means. What makes it think that 'if' is a variable, and not the start of an if statement?
Also, there are probably a fair amount of bugs after line 45, as I've only been discovering the bugs as mafia tells me there's a problem. If you guys can, please don't tell me about any of the bugs after line 45. I think I found all the bugs before line 45 thanks to mafia (if I'm wrong about this, please let me know). But for every line after line 45, please don't tell me about any bugs. I'm still learning to script, and I'll learn faster if the debugging process is as reasonably painful as possible (so I'll be extra motivated to not make common bugs).
I ask for help on line 45 because I've spent a fair amount of time trying to figure it out myself... but it's getting kind of ridiculous, and the solution is probably really easy, and I'm missing it because I'm spending too much time on it.
This script is designed to get me through the sewer, and only the sewer. First it gets the items to make the run as short as possible. Then it equips the outfit, mood, and familiar I want. Then it adventures in the sewers. Then it takes the items dropped and does stuff with them. And finally it switches back to my standard outfit, mood, and familiar. Here's what I have so far:
Code:
// This is my first attempt to make a somewhat complicated script.
// If there are better ways to do the below, please let me know!
void main ()
{
// get items
if (item_amount( $item[gatorskin umbrella] ) < 10)
retrieve_item (10, $item[gatorskin umbrella]);
if (item_amount ( $item[unfortunate dumplings] ) < 10)
retrieve_item (10, $item[unfortunate dumplings]);
if (item_amount ($item[sewer wad] ) < 10)
retrieve_item (10, $item[sewer wad]);
if (item_amount ($item[bottle of ooze-o] ) <10)
retrieve_item (10, $item[bottle of ooze-o]);
if (item_amount ($item[Oil of oiliness] ) < 30)
retrieve_item (30, $item[Oil of oiliness]);
// put on some pants, change your attitude, and bring a friend
outfit ("Sewer");
// I can't seem to find the ash equivalent of these next two things. Anyone know what they are?
cli_execute ("mood +ml-combat");
cli_execute ("familiar animated macaroni duck");
// will this next line cause the script to break if it finishes in less than 100 turns?
adventure(100 , $location[a maze of sewer tunnels] );
// You got some items! What to do?
// make gatorskin umbrellas
if ( have_skill ($skill[armorcraftiness]))
{
int gatorskins = item_amount( $item[gator skin] );
retrieve_item (gatorskins, $item[titanium assault umbrella]);
create (gatorskins, $item[gatorskin umbrella]);
}
// make unfortunate dumplings. [B]This next part is line 45[/B]
if (( have_skill ($skill[transcendental noodlecraft])) && (((if my_class() == ($class[pastamancer])) || if (my_class() == ($class[sauceror])))))
{
int chums = item_amount ($item[C.H.U.M. chum]);
retrieve_item (chums, $item[MSG]);
retrieve_item (chums, $item[dry noodles]);
create (chums, $item[Unfortunate dumplings]);
}
// make oil of oiliness
if ( have_skill ($skill[advanced saucecrafting]) )
{
int livers = item_amount ($item[decaying goldfish liver]);
retrieve_item (livers, $item[scrumptious reagent]);
create (livers, $item[oil of oiliness]);
}
// Oh boy! Time for Schnapps!
int stills_available;
int schnapps = item_amount ($item[bottle of sewage schnapps]);
if (stills_available > 0 && schnapps > 0)
{
if stills_available < schnapps
create (stills_available, $item[bottle of ooze-o]);
if stills_available > schnapps
create (schnapps, $item[bottle of ooze-o]);
}
// and last but not least...
cli_execute ("send * sewer nuggets to smashbot");
// if I lack the skills, send the items to sellbot, let him deal with my crap
// is there an ash equivolent?
cli_execute ("send * gator skin, * decaying goldfish liver, * bottle of sewage schnapps, * C.H.U.M. chum to sellbot");
// Ok, back to normal
outfit ("DA");
cli_execute ("mood +ml");
cli_execute ("familiar jumpsuited hound dog");
}
After spending a great deal of time debugging, I've run into a problem that I don't know how to solve. I keep getting the following error:
"Unknown variable 'if' (Sewer.ash, line 45)"
I have no idea what this means. What makes it think that 'if' is a variable, and not the start of an if statement?
Also, there are probably a fair amount of bugs after line 45, as I've only been discovering the bugs as mafia tells me there's a problem. If you guys can, please don't tell me about any of the bugs after line 45. I think I found all the bugs before line 45 thanks to mafia (if I'm wrong about this, please let me know). But for every line after line 45, please don't tell me about any bugs. I'm still learning to script, and I'll learn faster if the debugging process is as reasonably painful as possible (so I'll be extra motivated to not make common bugs).
I ask for help on line 45 because I've spent a fair amount of time trying to figure it out myself... but it's getting kind of ridiculous, and the solution is probably really easy, and I'm missing it because I'm spending too much time on it.