Skip to content

Instantly share code, notes, and snippets.

@lordgmage
Created December 9, 2015 16:21
Show Gist options
  • Save lordgmage/1b51dffd6a97d06e1277 to your computer and use it in GitHub Desktop.
Save lordgmage/1b51dffd6a97d06e1277 to your computer and use it in GitHub Desktop.
please fix!
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 !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