Crimbo Mining Script

ereinion

Member
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...
 

bombar

Member
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...

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.
 

bombar

Member
Just uploaded v1.11, this version is in response to a comment Jick made during weekly radio show where you will only ever need as many nuggets as you have molds. While I don't do this check, I do allow you to now specify that you only want to mine peppermints from caves, and skip all the nuggets.

And then uploaded v1.12, this version allows for users to set a delay in seconds between mining attempts. Reason from a user suggestion: "Would you consider adding an optional delay between each dig? People who start the script and then go to prepare supper or chat with their clan for an hour don't need top notch speed."
 
Last edited:

Immelan

New member
Great work on the continued progress for this script. I was still on the original when I decided to come back and grab an updated version. As for Jick's comment about nuggets, the easiest logic test that I'm aware of would be
Code:
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);

This would allow a user to tailor how many extra nuggets they want to have on hand. In my case, I'd set it to around 80 as that is how many molds I tend to get in the day. At the end of the day I do combines with the innabox smith.
 

Theraze

Active member
Has there been any better spading than ~170 relevant turns of farming for molds? I find that in the 161-170 turns, I still generally get a mold or two, but none after that. Which leads to the "adventure 170 crimb mining camp, <go mine for nuggets>" that I've been doing the last few days.
 

Immelan

New member
I've had molds drop post 200 turns in the mining camp, but my best day was 2 between turns 200 and 300. Most days it's only 1. Spending 200 turns in the mining camp and then farming elsewhere seems to be the meat friendly way to do things. However, flasks of mining oil drop the entire time, which can mean free mining of patties. It's a horse a piece in my opinion.
 

Immelan

New member
I refined my above code to work, instead of just suggesting what to you. I replaced your default statement about mining with this:
Code:
//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; }

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.
 

bombar

Member
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.

That should work, one issue you might run into is if you start the script at molds + 79 nuggets then by the end you could have way more then molds + 80 nuggets. Its one of the reasons I haven't provided an update with something like this there are a bunch of cases that could work, just none I'm totally thrilled with.

I would suggest two things, and is the way I'm leaning right now.

Keep your int maxExtraNuggets = X;

But move the conditional statement into then top of the handleCurrentMine() function.

Also move :
Code:
	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.
	}
Into the handleCurrentMine() function

So top of handleCurrentMine() should look like:

Code:
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>

This will make it so at most after running the script you will have a max of molds + maxExtraNuggets + 5 nuggets
 

bombar

Member
And that being said, thanks to working through the logic giving that suggestion I figured out something I'm happy with. The main sticking point was I didn't want to force someone into using that logic so instead if they specify a maxExtraNuggets less then 0 it ignores the concept of maxExtraNuggets, since I'm making the assumption that people will at least always want as many nuggets as they have molds, well sorry.

See version 1.13
 

bombar

Member
Found a bug today with the script if you are using it to burn turns mining, will post an updated version tonight when I get home but please if you are using the script and setUseFreeTurns to false, change the following line at the bottom of the file to reduce uncessary server hits:

Code:
while(counter < maxCaves) {

should become:

Code:
while(counter < maxCaves && my_adventures() > 0) {

Thank you

Update: Posted version 1.14. It fixes an issue where when using turns to mine, when you run out adventures it still checked up to your maxCaves number, now it properly aborts when it sees its out of adventures.

Also added the ability to state how many turns you want leftover after done mining when using turns.
 
Last edited:
Top