Created
April 16, 2015 16:48
-
-
Save lordgmage/a990565f5fd62e59300f to your computer and use it in GitHub Desktop.
:D
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 strategies; | |
import Main.LordWood; | |
import data.Constants; | |
import org.parabot.environment.api.utils.Time; | |
import org.parabot.environment.scripts.framework.SleepCondition; | |
import org.parabot.environment.scripts.framework.Strategy; | |
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 Normal implements Strategy { | |
@Override | |
public boolean activate() { | |
return !Inventory.isFull() ; | |
} | |
@Override | |
public void execute() { | |
SceneObject[] TREE_ID = SceneObjects.getNearest(LordWood.treeID); | |
if (TREE_ID != null && TREE_ID.length > 0 | |
&& TREE_ID[0].distanceTo() > 0 | |
&& Players.getMyPlayer().getAnimation() == -1) { | |
TREE_ID[0].interact(0); | |
} | |
final int previous = Inventory.getCount(); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.getCount() !=previous; | |
} | |
}, 5500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment