I'm having problems with this script if anyone could look over it and tell me wth is wrong with it and could fix its id be soo happy..
--------------------------------------------------------------------------------------------------------------------------------------------------------------- import org.osbot.script.Script;
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;
@ScriptManifest(name = "Dat RangeGuild V0.1 BETA", author = "GoldenGates", version = 0.1, info = "Gets Range Exp at the Range Guild.")
public class datRangeGuild extends Script {
int moneyID = 996;
int ticketID = 1465;
int bronzeArrowID = 882;
int judgeID = 693;
int targetID = 2513;
boolean readyToShoot = false;
boolean rightArea = true;
public void onStart() {
log("Starting Dat RangeGuild by GoldenGates!");
log("Please be sure that you are not currently competing in the minigame.");
log("Also make sure your camera IS AS LOW AS IT CAN GO!!!");
}
public void onStop() {
log("Thank you for using Dat RangeGuild by GoldenGates!");
}
public int onLoop() throws InterruptedException {
NPC judge = closestNPC(judgeID);
RS2Object target = closestObject(targetID);
if (client.getMyPlayer().getY() > 3421 || client.getMyPlayer().getX() > 2671)
{
log("Some how you got too far north, walking back");
walkExact(new Position(2670, 3418, 0));
}
if (client.getMyPlayer().isUnderAttack())
{
log("Oh no, someone attacked you.");
walkExact(new Position(2658, 3428, 0));
sleep(random(5000, 9000));
}
if (rightArea == true) {
if (judge != null && !client.getInterface(242).isValid()
&& !client.getInterface(230).isValid()
&& !client.getInterface(64).isValid()
&& !client.getInterface(241).isValid()
&& !client.getInterface(325).isValid()
&& !client.getInventory().contains(bronzeArrowID)
&& readyToShoot == false) {
selectEntityOption(judge, "Talk-to");
log("Talking to Judge");
sleep(random(500, 750));
}
if (client.getInterface(242).isValid() && readyToShoot == false) {
selectInterfaceOption(242, 4, "Continue", true);
log("Talking to Judge");
sleep(random(500, 750));
}
if (client.getInterface(242).isValid()) {
log("We see interface1");
selectInterfaceOption(242, 4, "Continue", true);
log("Interface1 clicked");
sleep(random(500, 750));
}
if (client.getInterface(230).isValid()) {
log("We see interface2");
selectInterfaceOption(230, 1, "Continue", true);
log("Interface2 clicked");
sleep(random(500, 750));
}
if (client.getInterface(64).isValid()) {
log("We see interface3");
selectInterfaceOption(64, 3, "Continue", true);
log("Interface3 clicked");
sleep(random(500, 750));
}
if (client.getInterface(241).isValid()) {
log("We see interface4");
selectInterfaceOption(241, 3, "Continue", true);
log("Interface4 clicked");
readyToShoot = true;
sleep(random(500, 750));
}
if (client.getInventory().contains(bronzeArrowID)) {
selectInventoryOption(
client.getInventory().getSlotForId(bronzeArrowID),
"Wield");
log("Equipping Arrows");
readyToShoot = true;
sleep(random(500, 750));
}
if (target != null && !client.getInterface(242).isValid()
&& !client.getInterface(230).isValidimport org.osbot.script.Script;
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;
@ScriptManifest(name = "Dat RangeGuild V0.1 BETA", author = "GoldenGates", version = 0.1, info = "Gets Range Exp at the Range Guild.")
public class datRangeGuild extends Script {
int moneyID = 996;
int ticketID = 1465;
int bronzeArrowID = 882;
int judgeID = 693;
int targetID = 2513;
boolean readyToShoot = false;
boolean rightArea = true;
public void onStart() {
log("Starting Dat RangeGuild by GoldenGates!");
log("Please be sure that you are not currently competing in the minigame.");
log("Also make sure your camera IS AS LOW AS IT CAN GO!!!");
}
public void onStop() {
log("Thank you for using Dat RangeGuild by GoldenGates!");
}
public int onLoop() throws InterruptedException {
NPC judge = closestNPC(judgeID);
RS2Object target = closestObject(targetID);
if (client.getMyPlayer().getY() > 3421 || client.getMyPlayer().getX() > 2671)
{
log("Some how you got too far north, walking back");
walkExact(new Position(2670, 3418, 0));
}
if (client.getMyPlayer().isUnderAttack())
{
log("Oh no, someone attacked you.");
walkExact(new Position(2658, 3428, 0));
sleep(random(5000, 9000));
}
if (rightArea == true) {
if (judge != null && !client.getInterface(242).isValid()
&& !client.getInterface(230).isValid()
&& !client.getInterface(64).isValid()
&& !client.getInterface(241).isValid()
&& !client.getInterface(325).isValid()
&& !client.getInventory().contains(bronzeArrowID)
&& readyToShoot == false) {
selectEntityOption(judge, "Talk-to");
log("Talking to Judge");
sleep(random(500, 750));
}
if (client.getInterface(242).isValid() && readyToShoot == false) {
selectInterfaceOption(242, 4, "Continue", true);
log("Talking to Judge");
sleep(random(500, 750));
}
if (client.getInterface(242).isValid()) {
log("We see interface1");
selectInterfaceOption(242, 4, "Continue", true);
log("Interface1 clicked");
sleep(random(500, 750));
}
if (client.getInterface(230).isValid()) {
log("We see interface2");
selectInterfaceOption(230, 1, "Continue", true);
log("Interface2 clicked");
sleep(random(500, 750));
}
if (client.getInterface(64).isValid()) {
log("We see interface3");
selectInterfaceOption(64, 3, "Continue", true);
log("Interface3 clicked");
sleep(random(500, 750));
}
if (client.getInterface(241).isValid()) {
log("We see interface4");
selectInterfaceOption(241, 3, "Continue", true);
log("Interface4 clicked");
readyToShoot = true;
sleep(random(500, 750));
}
if (client.getInventory().contains(bronzeArrowID)) {
selectInventoryOption(
client.getInventory().getSlotForId(bronzeArrowID),
"Wield");
log("Equipping Arrows");
readyToShoot = true;
sleep(random(500, 750));
}
if (target != null && !client.getInterface(242).isValid()
&& !client.getInterface(230).isValid()
&& !client.getInterface(64).isValid()
&& !client.getInterface(241).isValid()
&& !client.getInterface(325).isValid()
&& !client.getInventory().contains(bronzeArrowID)
&& readyToShoot == true) {
target.interact(false, "Fire-at");
sleep(random(500, 750));
}
if (judge != null && client.getInterface(242).isValid()
&& readyToShoot == true) {
selectInterfaceOption(242, 4, "Continue", true);
log("Getting Tickets");
readyToShoot = false;
sleep(random(500, 750));
}
if (client.getInterface(325).isValid()) {
selectInterfaceOption(325, 88, "Close", true);
}
} else {
walk(new Position(2671, 3418, 0));
sleep(random(1500, 2000));
}}
return 500 + random(500, 750);
}
public void onMessage(String message) {
if (message == "You should probably be behind the hay bales.") {
rightArea = false;
}
}