mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
Update WoodcutTree.java
This commit is contained in:
@@ -30,10 +30,24 @@ public class WoodcutTree implements Strategy {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
tree.interact(SceneObjects.Option.CHOP_DOWN);
|
||||
Time.sleep(1000);
|
||||
//Wait for the Player to chop the Tree
|
||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
|
||||
try {
|
||||
Trees myTree = Variables.woodcutting_tree_selected;
|
||||
if (myTree.hash == 0) {
|
||||
myTree.hash = tree.getHash();
|
||||
myTree.x = tree.getLocalRegionX();
|
||||
myTree.y = tree.getLocalRegionY();
|
||||
}
|
||||
// 502, rock_hash, local_x, local_y, 4
|
||||
Menu.sendAction(502, myTree.hash, myTree.x, myTree.y, 3);
|
||||
// Wait 1.5 seconds for the player to reach the tree
|
||||
Time.sleep(1500);
|
||||
// Sleep until player is cutting the tree for a maximum of 2 seconds
|
||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() != -1, 2000);
|
||||
// Sleep until not woodcutting for a maximum of 10 seconds
|
||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 10000);
|
||||
} catch (Exception err){
|
||||
System.out.println("Woodcutting error: ¯\\_(ツ)_/¯");
|
||||
}
|
||||
}
|
||||
|
||||
private SceneObject tree(){
|
||||
|
||||
Reference in New Issue
Block a user