Check player has a knife too

This commit is contained in:
RedSparr0w
2019-10-12 14:00:50 +13:00
parent fab2b25fb0
commit 658cc2930e
@@ -18,7 +18,7 @@ public class MakeArrowShafts implements Strategy {
@Override @Override
public boolean activate() { public boolean activate() {
if (Variables.running if (Variables.running
&& hasLogs() && hasRequiredItems()
&& (Variables.getStatus() == "none" || Variables.getStatus() == "making arrow shafts") && (Variables.getStatus() == "none" || Variables.getStatus() == "making arrow shafts")
&& !Players.getMyPlayer().isInCombat() && !Players.getMyPlayer().isInCombat()
&& Players.getMyPlayer().getAnimation() == -1) { && Players.getMyPlayer().getAnimation() == -1) {
@@ -34,14 +34,14 @@ public class MakeArrowShafts implements Strategy {
System.out.println("making arrow shafts"); System.out.println("making arrow shafts");
Inventory.getItem(947).interact(Items.Option.USE); Inventory.getItem(947).interact(Items.Option.USE);
Inventory.getItem(1512).interact(Items.Option.USE_WITH); Inventory.getItem(1512).interact(Items.Option.USE_WITH);
Menu.clickButton(8886); Menu.clickButton(8886);
Time.sleep(3000); Time.sleep(3000);
//Wait for the Player to chop the Tree //Wait for the Player to chop the Tree
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000); Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
} }
private boolean hasLogs(){ private boolean hasRequiredItems(){
return Inventory.contains(1512); // Make sure we have a knife and logs
return Inventory.contains(947, 1512);
} }
} }