Phys Ex - Oak
No notes
Syntax:
Java
import org.rsbot.script.Script; import org.rsbot.script.ScriptManifest; import org.rsbot.script.methods.Skills; import org.rsbot.script.wrappers.RSObject; @ScriptManifest(authors = "Loading, B3TA", name = "PhEx Oak Cutter", version = 1.0, description = "Test") public class PhExOak extends Script { private int Tree[] = {1281}; private final int[] hatchetIDs = {1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739, 13470}; private int log = 1521; private int Stump[] = {1356}; public boolean onStart(){ if (equipment.containsOneOf(hatchetIDs) == true) { log("You have an axe equiped, script will now continue."); } else if (inventory.containsOneOf(hatchetIDs) == true) { log("You have an axe on your inventory, script will now continue."); } else if (equipment.containsOneOf(hatchetIDs) == false || (inventory.containsOneOf(hatchetIDs) == false)) { stopScript(); log("No hatchet found. Please start the script with a hatchet equiped or on your inventory."); } mouse.setSpeed(random(8, 14)); return true; } @SuppressWarnings("static-access") public void antiban() { int a = random(0, 10); if (random(0, 4)==0 || mouse.getSpeed() < 9 || mouse.getSpeed() > 13) { mouse.setSpeed(random(3, 6)); } switch (a) { case 1: if (random(0, 6) == 0) { game.openTab(1); skills.doHover(skills.INTERFACE_WOODCUTTING); sleep(random(2100, 3400)); } case 2: if (!getMyPlayer().isIdle()) { camera.setAngle(random(20,80)); sleep(random(1000,2000)); } } } @Override public int loop() { if(inventory.isFull()){ inventory.dropAllExcept(hatchetIDs); } else if(getMyPlayer().getAnimation() != 867) { RSObject tree = objects.getNearest(Tree); if(tree != null){ tree.doAction("Chop"); sleep(200, 350); antiban(); sleep(1000,2000); } } return 0; } }