November 22, 201312 yr https:/import org.osbot.script.ScriptManifest; import org.osbot.script.rs2.map.Position; import org.osbot.script.rs2.model.NPC; import org.osbot.script.rs2.model.RS2Object; import org.osbot.script.rs2.ui.RS2Interface; import org.osbot.script.rs2.ui.RS2InterfaceChild; import org.osbot.script.rs2.utility.Area; import org.osbot.script.rs2.Client; import java.awt.*; @ScriptManifest(name = "RangeGuilder", author = "Aero", version = 0.5D, info = "A ranged guild script.") public class RangeGuilder extends Script { private final static int JUDGE = 693; private final static int TARGET = 2513; private final static int BRONZE_ARROW = 882; private final static int LADDER_UP = 2511; private final static int LADDER_DOWN = 2512; private final static int CAMELOT_TELEPORT = 8010; private final static Position RETURN_POSITION = new Position(2670, 3418, 0); private enum State { SHOOT, EQUIP_ARROWS, TALK_TO_JUDGE, RETURNING, ESCAPE } private State state = State.SHOOT; public void onStart() { positionScreen(); } public int onLoop() { switch(state) { case State.SHOOT: onShoot(); break; case State.EQUIP_ARROWS: onEquip(); break; case State.TALK_TO_JUDGE: onTalk(); break; case State.ESCAPE: onEscape(); break; case State.RETURNING: onReturning(); break; } return 0; } public void onMessage(String message) { if (message == "You should probably be behind the hay bales." || message == "You've fired all your arrows, maybe you should talk to the Judge." || message == "Maybe you should ask before using those.") { state = State.RETURNING; } } private void onShoot() { if (searchInterfacesForText("Sorry, you may").isEmpty() && searchInterfacesForText("I suggest").isEmpty() && searchInterfacesForText("Well done").isEmpty()) { if (client.getMyPlayer().isUnderAttack()) { state = State.ESCAPE; return; } else if (client.getInterface(325) == null) { selectEntityOption(closestObject(TARGET), "Fire-at", true, false); sleep(400 + random(100)); } else { selectInterfaceOption(325, 88, "Close", true); } } if (searchInterfacesForText("Sorry, you may").size() >= 1 || searchInterfacesForText("Well done").size() >= 1 ) { state = State.TALK_TO_JUDGE; } else if (searchInterfacesForText("I suggest").size() >= 1) { state = State.EQUIP_ARROWS; } } private void onTalk() { selectEntityOption(closestNPC(JUDGE), "Talk-to", false); sleep(300 + random(50)); waitForClickContinue(); sleep(600 + random(100)); waitForAccept(); sleep(600 + random(100)); waitForClickContinue(); sleep(600 + random(100)); waitForClickContinue(); sleep(500 + random(50)) if (searchInterfacesForText("Oops,").size() >= 1) { log("Ran out of coins for the mingame. Stopping.") stop(); } state = State.SHOOT; } private void onEquip() { selectInventoryOption(client.getInventory().getSlotForId(BRONZE_ARROW),"Wield"); state = State.SHOOT; } private void onEscape() { selectEntityOption(closestObject(LADDER_UP), "Climb-up"); while (client.getMyPlayer().getZ() == 0) { selectEntityOption(closestObject(LADDER_UP), "Climb-up"); sleep(3000); } sleep(6000); while (client.getMyPlayer().getZ() == 2) { selectEntityOption(closestObject(LADDER_DOWN), "Climb-down") sleep(2000); } state = State.RETURNING; } private void onReturning() { while (walkExact(RETURN_POSITION, 0) == false) { sleep(6000); } state = State.SHOOT; } private void waitForClickContinue() { int i = 0; sleep(300); while (searchInterfacesForText("Click here to continue").isEmpty()) { if (client.getMyPlayer().isUnderAttack()) { state = State.ESCAPE; return; } if (i >= 20) { return; } sleep(100); i++; } while (clickContinue() == false) { if (client.getMyPlayer().isUnderAttack()) { state = State.ESCAPE; return; } if (i > 25) { return; } sleep(500); i++ } } private void waitForAccept() { int i = 0; sleep(300); while (searchInterfacesForText("Sure, I'll give it a go").isEmpty()) { if (client.getMyPlayer().isUnderAttack()) { state = State.ESCAPE; return; } if (i >= 20) { return; } sleep(100); i++; } while (accept() == false) { if (client.getMyPlayer().isUnderAttack()) { state = State.ESCAPE; return; } if (i >= 25) { return; } sleep(600); i++ } } private boolean clickContinue() { return searchInterfacesForText("Click here to continue").get(0).interact("Continue"); } private boolean accept() { return searchInterfacesForText("Sure, I'll give it a go").get(0).interact("Continue"); } private void positionScreen() { while (!walkExact(RETURN_POSITION)) { sleep(500); } client.rotateCameraToAngle(330); client.rotateCameraPitch(22); } }
November 22, 201312 yr This may work: http://uppit.com/hhsz2uv1g25o/RangeGuilder.jar Not too sure about it, the script had A LOT of errors in it that needed fixing.
November 22, 201312 yr Author This may work: http://uppit.com/hhsz2uv1g25o/RangeGuilder.jar Not too sure about it, the script had A LOT of errors in it that needed fixing. can you teach me how you did that?