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.

Range Guild Script

Featured Replies

Hey Guys I am requesting a range guild script, I have the code for one from OSBOT 1, which will not work with OSBOT 2. I don't know if this will help in making one, but it doesnt hurt to try, and I know nothing about coding, so I decided to post it here.

 

This code was also released a long time ago, the owner gave permission to use/edit it.

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

Thanks,

Empathy

Edited by empathy

That shiz is like knocking on jagex's door and asking for a ban doe.

  • 3 weeks later...

high ban rate i think tho,

script would be nice if wasnt so risky

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.