Mr.Mine

Mr.Mine

79 ratings
Ultimate Automation Guide (Combat, Chest, Sell, and more !)
By Nub.John
The Ultimate Automation Guide for Mr.Mine !
2
2
2
   
Award
Favorite
Favorited
Unfavorite
Chest Looting Automation
Purpose
Avoid looting all these magnificient chests
Target File(s)
resources/app/Shared/src/chest/ChestService.js

We're going to apply 2 changes in the code
  • When a chest is spawning, we want to remove the Chest Collector logic and immediately open it
  • When a chest is looted (when you click on it), we want to collect it instead of opening a popup

When a chest is spawning
Jump to the spawnChest() function, line 67
spawnChest(tenthOfDepth, source = Chest.natural, isGolden = false, validBlockDepths) { if(source == Chest.natural && !this.isChestCollectorFull() && rand(1, 100) <= this.getStoredChestsChance()) { this.chestsStored++; } else { this.chests[tenthOfDepth] = source.new(source, tenthOfDepth, isGolden, validBlockDepths); } }
This function will try first to store your new chest if you have unlocked the Chest Collector, and if it was not successful, it will spawn this new chest in the world.

We don't want to use the Chest Collector anymore, so remove the condition and only add the new chest in the world :
spawnChest(tenthOfDepth, source = Chest.natural, isGolden = false, validBlockDepths) { this.chests[tenthOfDepth] = source.new(source, tenthOfDepth, isGolden, validBlockDepths); this.presentChest(tenthOfDepth); }

When a chest is looted
Jump to the presentChest() function, line 202 (original file line index)
See what it is beginning with :
if(!keysPressed["Shift"]) { openUi(ChestWindow, undefined, chest); } else { this.giveChestReward(chest.tenthOfDepth); newNews(_("You got {0} from a Chest!", chestService.getChestRewardText()), true); }
You can see that there is an hidden feature : when you press Shift and you click on a chest, no popup will show and you will immediately loot is content.

That's exactly what we wanna do, because it will avoid the popup each time we click on a chest, or each time we call this function, so you should replace these lines by the else part :
this.giveChestReward(chest.tenthOfDepth); newNews(_("You got {0} from a Chest!", chestService.getChestRewardText()), true);

Credits
This is an updated version of the old and outdated Chest Looting Automation tutorial from tusan jaja, with the fix for the Chest Collector :
https://steamcommunity.com/sharedfiles/filedetails/?id=2504837145
Minerals Selling Automation
Purpose
Avoid having to sell minerals when storage is full
Target File(s)
resources/app/Shared/mineralmanagement.js

We're going to apply 1 change in the code
  • When minerals storage is full and the audio alarm is not set, sell all minerals

Jump to the bottom of the getUsedMineralCapacity(), line 1164
if(mutecapacity == 0 && isCapacityFull()) { capacityFullAudio.play(); }
This line play the alarm sound when minerals storage is full and if you turned it on.

What we want is auto-sell your minerals if the alarm is not activated.
Like this you will be able to stop the auto-sell by removing the alarm, and you will be able to be notified by the little sound if you want to do things manually.

Change all the condition to this :
if(isCapacityFull()) { if(mutecapacity == 0) { capacityFullAudio.play(); } if(mutecapacity == 1) { sellAllMinerals(0); } }
Battle Automation (Depth 304+)
Purpose
Avoid having to manage these battles
Target File(s)
resources/app/popups/BattleWindow.js
resources/app/Shared/battle.js

We're going to apply 2 changes in the code
  • One to auto-attack during battles
  • One to auto-start battles when they spawn

Auto-attack during battles
In BattleWindow.js, jump to the render() function, line 99
this.context.globalAlpha = 1;
You should add another line below to auto-use your weapons during a battle when they are ready :
this.context.globalAlpha = 1; atk(bi);

Auto-start battles when they spawn
In battle.js, jump to line 665
battleWaiting = [spawnX, spawnY, spawnMonDetails[0], spawnMonDetails[1]];

When you click on a Worker who is attacked by a monster, the function called is battleui().
Replace the previous line by a call to this function :
battleui(spawnMonDetails[0], spawnMonDetails[1]);

Credits
This is an enhanced version of the Combat Automation tutorial from Sebastian, with in addition automation for battle auto-start :
https://steamcommunity.com/sharedfiles/filedetails/?id=2429496307
Drill Upgrade Automation
I'm working on it ;)
Coming Soon !
Scientist Expedition Automation
I'm working on it ;)
Coming Soon !
Gem Crafting Automation (Depth 301+)
I'm working on it ;)
Coming Soon !
Weapons Upgrade Automation (Depth 304+)
I'm working on it ;)
Coming Soon !
74 Comments
automated chest grabbing not working :demise:
GanaSensei Nov 24, 2024 @ 8:41pm 
Win every battle
in battle.js line 145
"if(this.activeMonster.currentHealth >= 0)"

change <= to >=

attack just once and get reward
Mangogh Nov 22, 2024 @ 6:40pm 
Well the update fucked up alot of things but thankfully the auto sell minerals based on the sound cue being on or off still works
Stitch Oct 14, 2024 @ 6:59am 
ChestCompressor automate.
Target File: resources\app\Shared\src\chest\ChestCompressor.js
Comment: create automateChestCompression() function and call it inside update(dt) on line 19

automateChestCompression() {
// Check the types of chests available for compression
for (let chestType in this.chestStats) {
if (this.canQueueChest(chestType)) {
this.addChestToQueue(chestType);
}
}
}

update(dt) {
for (var i = this.queuedChests.length; i > 0; i--) {
this.queuedChests [1] -= dt;

if (this.queuedChests [1] <= 0) {
this.grantChestAndRemoveFromQueue(i - 1);
}
}
// Checks if the queue is empty and adds available chests
if (this.queuedChests.length < this.getSlotCount()) {
this.automateChestCompression();
}
}
Stitch Oct 13, 2024 @ 8:45am 
yellow gem auto crafting. // Call it inside update(seconds) like below, change the name function after this.add

addYellowGemIfPossible() {
const requiredRedGems = 25;
const requiredGreenGems = 25;

const missingRedGems = Math.max(
0,
requiredRedGems - worldResources[RED_FORGED_GEM_INDEX].numOwned
);
const missingGreenGems = Math.max(
0,
requiredGreenGems - worldResources[GREEN_FORGED_GEM_INDEX].numOwned
);

if (missingRedGems > 0 && this.canQueueGem(RED_FORGED_GEM_INDEX)) {
this.addGemToQueue(RED_FORGED_GEM_INDEX);
}

if (missingGreenGems > 0 && this.canQueueGem(GREEN_FORGED_GEM_INDEX)) {
this.addGemToQueue(GREEN_FORGED_GEM_INDEX);
}
while (
worldResources[RED_FORGED_GEM_INDEX].numOwned >= requiredRedGems &&
worldResources[GREEN_FORGED_GEM_INDEX].numOwned >= requiredGreenGems &&
this.canQueueGem(YELLOW_FORGED_GEM_INDEX)
) {
this.addGemToQueue(YELLOW_FORGED_GEM_INDEX);
}
}
Stitch Oct 13, 2024 @ 8:28am 
Green gem auto crafting.

Target file: resources/app/Shared/GemForge.js
Comment: create addGreenGemsAutomatically() function and call it inside update(seconds) on line 235

addGreenGemsAutomatically() {
while (
this.potentialAdditionalLoad() > 0 &&
this.canQueueGem(GREEN_FORGED_GEM_INDEX)
) {
this.addGemToQueue(GREEN_FORGED_GEM_INDEX);
}
}

update(seconds) {
this.forgeQueue.updateQueuedGems(seconds);
this.addGreenGemsAutomatically();
}
Mangogh Aug 7, 2024 @ 12:22am 
Notes to update:

Chest Looting Automation: has been entirely reworked and will need to be looked at.

Minerals Selling Automation: moved from line 1164 to 1628. code needed to replace and paste has not been changed, although I would

Battle Automation (Depth 304+): battlewindow.js line has been moved from 99 to 109 (when you search for the line of code that will be above the line you add, it will be the top result). battle.js line has moved from 665 to 636.

I would also look here and the comment about all mineral selling: https://steamcommunity.com/sharedfiles/filedetails/?id=2886666262
SRB Mar 6, 2024 @ 8:53am 
amazing, keep us posted on future updates!