Created
December 9, 2015 16:26
-
-
Save lordgmage/5134fb243bd91dd0505d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.parabot.lord.lordwoodcutting.strategies; | |
import org.parabot.environment.api.utils.Time; | |
import org.parabot.environment.scripts.framework.SleepCondition; | |
import org.parabot.environment.scripts.framework.Strategy; | |
import org.parabot.lord.lordwoodcutting.data.Variables; | |
import org.rev317.min.api.methods.Inventory; | |
import org.rev317.min.api.methods.Players; | |
import org.rev317.min.api.methods.SceneObjects; | |
import org.rev317.min.api.wrappers.SceneObject; | |
public class Cut implements Strategy { | |
SceneObject[] TREE; | |
public boolean activate() { | |
return | |
TREE == SceneObjects.getNearest(Variables.tree) && | |
!Inventory.isFull() && Players.getMyPlayer().getAnimation() == -1; | |
} | |
public void execute() { | |
if (SceneObjects.getNearest(Variables.tree) != null | |
&& TREE.length > 0) { | |
System.out.println("Working"); | |
TREE[0].interact(SceneObjects.Option.CHOP_DOWN); | |
} | |
if (Players.getMyPlayer().getAnimation() == -1){ | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Players.getMyPlayer().getAnimation() != -1; | |
} | |
},1000); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment