Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Amazing] RangingGuild script [30k+ xp/hour]

Featured Replies

 

 

[ERROR][07/15/13 01:20:21 PM]: Error on executing script worker!

java.lang.ArrayIndexOutOfBoundsException: -1

at org.osbot.script.rs2.ui.Inventory.interactWithSlot(pi:1012)

at org.osbot.script.MethodProvider.selectInventoryOption(ki:933)

at org.osbot.script.MethodProvider$selectInventoryOption.callCurrent(Unknown Source)

at RangeGuilder.onEquip(RangingGuilder.groovy:125)

at RangeGuilder.onLoop(RangingGuilder.groovy:66)

at org.osbot.x.run(qm:182)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Ive been getting this lately, stops the script.

I've been getting something similar, if not the exact same error.
its because you use a weird ammount of arrows. have like 100 equippes, not 104 etc.

also im soon getting my pc back and releasing 1.2

 

But you get things like 99 arrows when it misclicks on a guard.. so it's inevitably going to happen

Seriously needs to be updated asap. New chat box, Non spamming clicks.

  • Author

Seriously needs to be updated asap. New chat box, Non spamming clicks.

Again I'm sorry, will first be getting my pc back in next week. You guys gotta hang on. The script seems to be working completely fine though as I still get 15+ hour proggies.

 

 

[ERROR][07/15/13 01:20:21 PM]: Error on executing script worker!

java.lang.ArrayIndexOutOfBoundsException: -1

at org.osbot.script.rs2.ui.Inventory.interactWithSlot(pi:1012)

at org.osbot.script.MethodProvider.selectInventoryOption(ki:933)

at org.osbot.script.MethodProvider$selectInventoryOption.callCurrent(Unknown Source)

at RangeGuilder.onEquip(RangingGuilder.groovy:125)

at RangeGuilder.onLoop(RangingGuilder.groovy:66)

at org.osbot.x.run(qm:182)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Ive been getting this lately, stops the script.

I've been getting something similar, if not the exact same error.
its because you use a weird ammount of arrows. have like 100 equippes, not 104 etc.

also im soon getting my pc back and releasing 1.2

 

 

 

Had 2,000 arrows equipped.

 

Anyway, no worries, appreciate it mate.

 

My scirpt has gotten stuck prolly 3-4 times, i hope to god i havnt got reported. 

I got banned cause it kept getting stuck :/ Only this time i wasnt there to try and help it </3

yeh, i dont recommend using this unless you sit there and baby sit the damn thing.

 

additionally, change the sleep timer so you dont spam click the shit outta the target, you get less exp but its less bot like. 

my bot running this script wont click on the judge anymore, been working flawless for my accounts but im sure theyve changed the id, there doing an update right now aswell

runescape updated this is currently occuring.

 

 

 

[ERROR][07/18/13 07:41:05 AM]: Error on executing script worker!
java.lang.NullPointerException
at org.osbot.script.MethodProvider.selectEntityOption(ki:1866)
at org.osbot.script.MethodProvider$selectEntityOption.callCurrent(Unknown Source)
at RangeGuilder.onShoot(RangingGuilder.groovy:93)
at RangeGuilder.onLoop(RangingGuilder.groovy:63)
at org.osbot.x.run(qm:182)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

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!");
	}
}

Edited by Ibotfishingexp

 

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!");
	}
}

I put this in my notepad than save it as RangeGuilder.groovy but its doesnt appear in my scripts??

 

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.