diff --git a/bin/CursorTask.class b/bin/CursorTask.class index 01a8865..6c88bbe 100644 Binary files a/bin/CursorTask.class and b/bin/CursorTask.class differ diff --git a/bin/main.class b/bin/main.class index 2e9c9c7..e1f966c 100644 Binary files a/bin/main.class and b/bin/main.class differ diff --git a/src/CursorTask.java b/src/CursorTask.java index 86ab0a4..efb586a 100644 --- a/src/CursorTask.java +++ b/src/CursorTask.java @@ -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); diff --git a/src/main.java b/src/main.java index e43685f..e5ea76b 100644 --- a/src/main.java +++ b/src/main.java @@ -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)); }