Is there any reasonably simple way to get this script to return e.g. a boolean value upon it having burned all free mining turns, instead of aborting mafia? I tried having a look, but I am having a bit of a problem seeing what calls what...
Thanks for the help! Applying the changes you suggest seems to work.Make no promises this works, but you can at least see the places you would need to change:
http://pastebin.com/vbvZhBQG
Note to everyone else, don't recommend using that, its untested, updated version will always be at top of this thread.
int maxExtraNuggets = 70;
if ( item_amount( $ item[nugget of crimbonium] ) > (( item_amount( $ item[cylindrical mold])) + maxExtraNuggets))
"Call section of script to mine patties only";
else ("Call section of script to mine nuggets);
//number of extra nuggets to check for
int maxExtraNuggets = 80;
boolean mineOnlyPeppermints = false;
if ( item_amount( $ item[nugget of crimbonium] ) > (( item_amount( $ item[cylindrical mold])) + maxExtraNuggets)){
mineOnlyPeppermints = true; }
else { mineOnlyPeppermints = false; }
I refined my above code to work, instead of just suggesting what to you. I replaced your default statement about mining with this:
When I tested the logic back and forth with different numbers, it worked, so I'll be running it in my copy. Feel free to add it to yours as well.
if (mineOnlyPeppermints) {
if (minNumberTailingsPerCave < 12) {
print("You have selected to only mine peppermints, but the min number of peppermints is quite low, setting min number ot peppermints to a higher number to reduce kol server load of getting new cave walls.", "red");
minNumberTailingsPerCave = 20;
}
maxFailsAllowed = 5;//If only mining peppermints all caves are valid.
}
void handleCurrentMine() {
if ( item_amount( $ item[nugget of crimbonium] ) > (( item_amount( $ item[cylindrical mold])) + maxExtraNuggets)){
mineOnlyPeppermints = true;
} else { mineOnlyPeppermints = false; }
if (mineOnlyPeppermints) {
if (minNumberTailingsPerCave < 12) {
print("You have selected to only mine peppermints, but the min number of peppermints is quite low, setting min number ot peppermints to a higher number to reduce kol server load of getting new cave walls.", "red");
minNumberTailingsPerCave = 20;
}
maxFailsAllowed = 5;//If only mining peppermints all caves are valid.
}
if (have_effect($effect[Crimbonar]) == 0 && have_effect($effect[object detection]) == 0) { <rest of function>
while(counter < maxCaves) {
while(counter < maxCaves && my_adventures() > 0) {