If this doesn't work for you, then Jagex has changed how ID's work for all players. Click the cog in the top right and choose "advanced" followed by "object info" Stand next to the targets and find the white number next to them. Replace "2513" with that number. Also check the judges npc ID.
I can supply a hotfix until the scriptor can fix his script.
I've also fixed the issue with the judge.
This is a hotfix, I highly recommend you babysit your bot.
import java.io.IOException;
import java.net.URL;
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 javax.imageio.ImageIO;
import java.awt.*;
@ScriptManifest(name = "RangeGuilder", author = "Rapidz", version = 1.1D, info = "Next generation 07 RuneScape RangeGuilding script, stable and almost flawless.")
public class RangeGuilder extends Script {
Image background = getImage("http://i.imgur.com/Or2kp76.png");
public long startTime; // Bot starting time
private final static int JUDGE = 693;
private final static int TARGET = 15545;
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);
public int startRangedExp;
public int lastRangedExpPerHour;
public int rangedExpToLvl;
public long lastExpCheck;
private enum State {
SHOOT, EQUIP_ARROWS, TALK_TO_JUDGE, RETURNING, ESCAPE
}
private State state = State.SHOOT;
private int xpToLvl(int level, int currentExp) {
return Math.round(Math.round((((level+1)*(level)/8)+75*((Math.pow(2, (level+1)/7)-Math.pow(2, 1/7))/(Math.pow(2, 1/7)-1)))-currentExp));
}
private int xpPerHour(int currentExp, int startExp) {
return Math.round((((currentExp-startExp)*3600)/((System.currentTimeMillis()-this.startTime)/1000)));
}
public void onStart() {
positionScreen();
log("Rapidz RangeGuilder - Version 1.1 Running");
int rangedLvl = this.client.getSkills().getLevel(Skill.RANGED);
int rangedExp = this.client.getSkills().getExperience(Skill.RANGED);
this.startRangedExp = this.client.getSkills().getExperience(Skill.RANGED);
this.startTime = System.currentTimeMillis();
this.rangedExpToLvl = xpToLvl(rangedLvl, rangedExp);
this.lastRangedExpPerHour = 0;
this.lastExpCheck = System.currentTimeMillis();
}
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(1 + random(5));
} 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, stopped the script.")
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);
}
private Image getImage(String url) {
try { return ImageIO.read(new URL(url)); }
catch(IOException e) { return null; }
}
private String format(long totalSeconds) {
long hours = totalSeconds/3600;
long minutes = (totalSeconds-hours*3600)/60;
long seconds = totalSeconds-(hours*3600+minutes*60);
String hoursS = String.valueOf(hours);
if (hours < 10)
hoursS = "0" + hoursS;
String minutesS = String.valueOf(minutes);
if (minutes < 10)
minutesS = "0" + minutesS;
String secondsS = String.valueOf(seconds);
if (seconds < 10)
secondsS = "0" + secondsS;
return hoursS+":"+minutesS+":"+secondsS;
}
public void onPaint(Graphics g) {
g.drawImage(background, 8, 345, null);
int rangedLvl = this.client.getSkills().getLevel(Skill.RANGED);
int rangedExp = this.client.getSkills().getExperience(Skill.RANGED);
if ((System.currentTimeMillis()-this.lastExpCheck)>2000) {
this.lastRangedExpPerHour = xpPerHour(rangedExp, this.startRangedExp);
}
if ((System.currentTimeMillis()-this.lastExpCheck)>2000) {
this.rangedExpToLvl = xpToLvl(rangedLvl, rangedExp);
}
long runing = (System.currentTimeMillis()-this.startTime)/1000;
long timeToRangedLevel = 0;
if (this.lastRangedExpPerHour>0)
timeToRangedLevel = (this.rangedExpToLvl/this.lastRangedExpPerHour)*3600;
g.setColor(Color.WHITE);
g.setFont(g.getFont().deriveFont(10.0f));
g.drawString("Rapidz' RangingGuilder - Version 1.1", 25, 365);
g.drawString("Ranged level: " + rangedLvl, 25, 395);
g.drawString("Time till next level: " + format(timeToRangedLevel), 25, 410);
g.drawString("Exp til next level: " + this.rangedExpToLvl, 25, 425);
g.drawString("XP/Hour: " + this.lastRangedExpPerHour, 25, 440);
g.drawString("Script has been running for: " + format(runing), 25, 455);
}
public void onExit() {
long totalSeconds = (System.currentTimeMillis()-this.startTime)/1000;
int hours = (int) (totalSeconds/360);
int minutes = (int) ((totalSeconds-(hours*360))/60);
int seconds = (int) (totalSeconds-((hours*360)+(minutes*60)));
log("Thank you for using Rapidz' RangingGuilder!");
}
}