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
// Measured:
// Measured: 30 seconds, 29 seconds
public void optimizedDropAllItemsInInventory(Cursor cursor, Inventory inventory) throws InterruptedException {
for (int row = 0; row < 4; row++) {
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 {
Point coordinatesToRightClick = inventory.getClickCoordinatesCoordinatesForInventorySlot(row, column);

View File

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