1
0
mirror of https://github.com/davpapp/PowerMiner synced 2024-12-21 23:48:49 -05:00

Wrapped everything in main loop

This commit is contained in:
davpapp 2018-02-02 13:22:53 -05:00
parent faab5a5577
commit 88b16aeb5f
4 changed files with 9 additions and 12 deletions

Binary file not shown.

Binary file not shown.

View File

@ -8,8 +8,7 @@ public class CursorTask {
// Human drop time: 29 seconds // Human drop time: 29 seconds
// Measured: 30 seconds, 29 seconds
// Measured:
public void optimizedDropAllItemsInInventory(Cursor cursor, Inventory inventory) throws InterruptedException { public void optimizedDropAllItemsInInventory(Cursor cursor, Inventory inventory) throws InterruptedException {
for (int row = 0; row < 4; row++) { for (int row = 0; row < 4; row++) {
Point coordinatesToClick = dropItem(cursor, inventory, row, 0); Point coordinatesToClick = dropItem(cursor, inventory, row, 0);
@ -35,11 +34,6 @@ public class CursorTask {
} }
} }
/*public void dropBottomRow(Cursor cursor, Inventory inventory) throws InterruptedException {
for (int row = 0; row < 4; row++) {
dropItem(cursor, inventory, row, 6);
}
}*/
public Point dropItem(Cursor cursor, Inventory inventory, int row, int column) throws InterruptedException { public Point dropItem(Cursor cursor, Inventory inventory, int row, int column) throws InterruptedException {
Point coordinatesToRightClick = inventory.getClickCoordinatesCoordinatesForInventorySlot(row, column); Point coordinatesToRightClick = inventory.getClickCoordinatesCoordinatesForInventorySlot(row, column);

View File

@ -10,13 +10,16 @@ public class main {
Cursor cursor = new Cursor(); Cursor cursor = new Cursor();
CursorTask cursorTask = new CursorTask(); CursorTask cursorTask = new CursorTask();
//cursor.displayCursorPaths();
Inventory inventory = new Inventory(); Inventory inventory = new Inventory();
//inventory.update();
cursorTask.optimizedDropAllItemsInInventory(cursor, inventory);
while (true) {
System.out.println("Success!"); inventory.update();
if (inventory.isInventoryFull()) {
System.out.println("Inventory full. Emptying...");
cursorTask.optimizedDropAllItemsInInventory(cursor, inventory);
}
Thread.sleep(100);
}
//cursor.moveCursorToCoordinates(new Point(620, 420)); //cursor.moveCursorToCoordinates(new Point(620, 420));
} }