private List<Node> nodes = new ArrayList<Node>();
@[member=Override]
public void onStart() {
Collections.addAll(nodes,
new Chopping(this));
}
@[member=Override]
public int onLoop() throws InterruptedException {
for (Node n : nodes) {
if (n.validate()) {
n.execute();
break;
}
}
return 200;
}
Constants c = new Constants();
RS2Object tree = sA.objects.closest("Tree");
public Chopping(Script sA) {
super(sA);
// TODO Auto-generated constructor stub
}
@[member=Override]
public boolean validate() throws InterruptedException {
return !sA.inventory.isFull();
}
@[member=Override]
public int execute() {
if (tree != null) {
tree.interact("Chop down");
new ConditionalSleep(1000, 4000) {
@[member=Override]
public boolean condition() throws InterruptedException {
// TODO Auto-generated method stub
return !sA.myPlayer().isAnimating();
}
}.sleep();
} else {
sA.camera.toEntity(tree);
}
return 200;
}
}