2018-02-04 12:18:34 -05:00
|
|
|
import java.awt.AWTException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public class WillowChopper {
|
|
|
|
|
|
|
|
Cursor cursor;
|
|
|
|
CursorTask cursorTask;
|
|
|
|
Inventory inventory;
|
|
|
|
|
|
|
|
public WillowChopper() throws AWTException, IOException
|
|
|
|
{
|
|
|
|
cursor = new Cursor();
|
|
|
|
cursorTask = new CursorTask();
|
|
|
|
inventory = new Inventory();
|
|
|
|
}
|
|
|
|
|
2018-02-19 16:12:25 -05:00
|
|
|
public void run() throws Exception {
|
2018-02-04 12:18:34 -05:00
|
|
|
|
|
|
|
while (true) {
|
2018-02-19 16:12:25 -05:00
|
|
|
Thread.sleep(250);
|
2018-02-04 12:18:34 -05:00
|
|
|
/*
|
|
|
|
if (character.isCharacterEngaged()) {
|
|
|
|
// DO NOTHING
|
|
|
|
// do things like checking the inventory
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
find closest willow tree
|
|
|
|
chop willow tree
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
inventory.update();
|
|
|
|
if (inventory.isInventoryFull()) {
|
2018-02-19 16:12:25 -05:00
|
|
|
System.out.println("Inventory is full! Dropping...");
|
|
|
|
cursorTask.optimizedDropAllItemsInInventory(cursor, inventory);
|
|
|
|
//cursorTask.dropAllItemsInInventory(cursor, inventory);
|
2018-02-04 12:18:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|