From 88b16aeb5f3a6f2a0b06d10656a86570f72f859b Mon Sep 17 00:00:00 2001 From: davpapp Date: Fri, 2 Feb 2018 13:22:53 -0500 Subject: [PATCH] Wrapped everything in main loop --- bin/CursorTask.class | Bin 2597 -> 2597 bytes bin/main.class | Bin 898 -> 1094 bytes src/CursorTask.java | 8 +------- src/main.java | 13 ++++++++----- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/bin/CursorTask.class b/bin/CursorTask.class index 01a88656b37661c610bb20ddabe38ef2c50dd466..6c88bbe7ae41fff2b693d4e7627e055e10a04e09 100644 GIT binary patch delta 141 zcmZ1~vQ%V4Ae$;L11kd`13wUoG6*oJGYB#mFbFf4Gl(!a0mXb6co{+%#3z@r&0>_A zEXZCfDhE_A&%n)~08}pzgmOSV%99tf&*W5R;AGHX5Mt1r?8?#1stZ)7H~B0_BC8<- j7lYAcW6my7GX`d$$(#%pK)sd>5)9TrQ*0++;tU1=PMZ{2 delta 141 zcmZ1~vQ%V4Ae$;511keR5DGAeG6*uLGYBylFo-ai19?tBF&_p#h7bmc$z^P_7^No* zve$~r1Jx@qa5E?ZRVXmX1ED&D%H+lDGdXn`I2rVS`t>Kfax}9V1J#*KKFg8FYRZO>-PEwFvr%VQBc(+DU+x4 zD0cV(`tBr)o(er*v#@g z_@mN>!3c9E^DG4GYGuA#lK($-gJoXotUSn2I}&l-9n>BmSb%OWWhsZZVbcx$iaHAzY=B{`mmA)YMmGQypE3E0P3|>59@jFXj{{9wf z2t#n3h+r>aOa|y9A($k_D1&5)Q(%Y%qQXEv*EErpKn`u#M|s~#P89J-3~pCP-AE=Sq0h>KC0h$mv#e5;yywKC({ z5AG8-Gt%BL&vr2Aw7XL(Z)_|!r?e-cTX@1%W`%QTd`ip{2-hi7XGv6O{b$f)PbN); ZeGZVLS(d+!Bqd;hV@{+^aVk3&XTNJoDpCLd 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)); }