mirror of
https://github.com/davpapp/PowerMiner
synced 2024-11-14 05:25:08 -05:00
Working at 23k / xp an hour with 2 ores
This commit is contained in:
parent
390b9e157d
commit
957ddd61e1
@ -26,6 +26,10 @@ public class CursorTask {
|
||||
return (int) (Math.hypot(a.x - b.x, a.y - b.y));
|
||||
}
|
||||
|
||||
public void dropOre(Cursor cursor, Inventory inventory) throws Exception {
|
||||
dropItem(cursor, inventory, 0, 0);
|
||||
}
|
||||
|
||||
public void dropAllItemsInInventory(Cursor cursor, Inventory inventory) throws Exception {
|
||||
for (int row = 0; row < 4; row++) {
|
||||
for (int column = 0; column < 7; column++) {
|
||||
|
@ -79,6 +79,10 @@ public class Inventory {
|
||||
return inventorySlots[row][column].getItemNameInInventorySlot(items);
|
||||
}
|
||||
|
||||
public boolean inventorySlotIsEmpty(int row, int column) {
|
||||
return inventorySlots[row][column].isInventorySlotEmpty(items);
|
||||
}
|
||||
|
||||
public boolean isLastSlotInInventoryFull() {
|
||||
return !inventorySlots[Constants.INVENTORY_NUM_ROWS - 1][Constants.INVENTORY_NUM_COLUMNS - 1].isInventorySlotEmpty(items);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class IronMiner {
|
||||
count++;
|
||||
BufferedImage screenCapture = objectDetector.captureScreenshotGameWindow();
|
||||
|
||||
ArrayList<DetectedObject> detectedObjects = objectDetector.getObjectsInImage(screenCapture, 0.20);
|
||||
ArrayList<DetectedObject> detectedObjects = objectDetector.getObjectsInImage(screenCapture, 0.30);
|
||||
ArrayList<DetectedObject> ironOres = objectDetector.getIronOres(detectedObjects);
|
||||
|
||||
if (ironOres.size() == 0) {
|
||||
@ -99,11 +99,16 @@ public class IronMiner {
|
||||
oreLostCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inventory.update();
|
||||
if (!inventory.inventorySlotIsEmpty(0, 0)) {
|
||||
cursorTask.dropOre(cursor, inventory);
|
||||
}
|
||||
}
|
||||
|
||||
humanBehavior.randomlyCheckMiningXP(cursor);
|
||||
randomDetector.dealWithRandoms(screenCapture, cursor);
|
||||
dropInventoryIfFull();
|
||||
//dropInventoryIfFull();
|
||||
if (count % 100 == 0) {
|
||||
System.out.println((System.currentTimeMillis() - startTime) / 1000);
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user