Try Catch

This commit is contained in:
RedSparr0w
2019-10-14 14:44:59 +13:00
parent 0f355f3a78
commit 0ec30babb7
+11 -7
View File
@@ -31,13 +31,17 @@ public class MakeArrowShafts implements Strategy {
@Override
public void execute() {
System.out.println("making arrow shafts");
Inventory.getItem(947).interact(Items.Option.USE);
Inventory.getItem(1512).interact(Items.Option.USE_WITH);
Menu.clickButton(8886);
Time.sleep(3000);
//Wait for the Player to chop the Tree
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
try {
System.out.println("making arrow shafts");
Inventory.getItem(947).interact(Items.Option.USE);
Inventory.getItem(1512).interact(Items.Option.USE_WITH);
Menu.clickButton(8886);
Time.sleep(3000);
//Wait for the Player to chop the Tree
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
} catch (Exception err) {
System.out.println("Fletching error: ¯\\_(ツ)_/¯");
}
}
private boolean hasRequiredItems(){