Created
December 9, 2015 20:12
-
-
Save lordgmage/1575fa48ef8d8bb00a41 to your computer and use it in GitHub Desktop.
edit
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 { | |
public boolean activate() { | |
return !Inventory.isFull() && Players.getMyPlayer().getAnimation() == -1; | |
} | |
public void execute() { | |
SceneObject[] TREE_ID = SceneObjects.getNearest(Variables.tree); | |
if (TREE_ID.length > 0 && TREE_ID != null | |
&& TREE_ID[0].distanceTo() > 0 | |
&& Players.getMyPlayer().getAnimation() == -1) { | |
TREE_ID[0].interact(SceneObjects.Option.CHOP_DOWN); | |
} | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.isFull(); | |
} | |
}, 1000); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment