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.

[First Script] L4zyRunes

Featured Replies

Hey, I'm pretty new to the community just started learning my way around OSBot.
Here's a script I made in a day just to test the API out, releasing it here so other people might learn from it.
Not a great script but it does its job. (Feedback is appreciated)

import org.osbot.rs07.api.Chatbox;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import javax.swing.*;
import java.awt.*;

@ScriptManifest(author = "L4zy", info = "Buy runes and packs and deaths for profit", name = "L4zyRunes", version = 1,
        logo = "http://img1.ak.crunchyroll.com/i/spire3/1a84d4bbb792d9918a8ac703968830701329488092_large.jpg")
/**

 * Aubury(637)
 * Widdet info:
 * 300/2/8 = Death Runes
 * 300/2/9 = Fire rune pack
 * 300/2/10 = Water rune pack
 * 300/2/11 = Air rune pack
 * 300/2/12 = Earth rune pack
 * 300/2/13 = Mind rune pack
 * 300/2/14 = Chaos rune pack
 */
public class main extends Script {

    private boolean buyDeaths, buyFirePack, buyWaterPack, buyAirPack, buyEarthPack, buyMindPack,buyChaosPack;
    private boolean hoppingP2P;

    public enum States {Trading, Hoping, Idle, Unpacking}
    public States currentState;
    public void setCurrentState(States s) {
        this.currentState = s;
    }
    public States getCurrentState() {
        return this.currentState;
    }

    private boolean settingsGUI() {
        JCheckBox deathCheck = new JCheckBox("Death runes");
        JCheckBox firePackCheck = new JCheckBox("Fire rune pack");
        JCheckBox waterPackCheck = new JCheckBox("Water rune pack");
        JCheckBox airPackCheck = new JCheckBox("Air rune pack");
        JCheckBox earthPackCheck = new JCheckBox("Earth rune pack");
        JCheckBox mindPackCheck = new JCheckBox("Mind rune pack");
        JCheckBox chaosPackCheck = new JCheckBox("Chaos rune pack");
        JCheckBox hopP2P = new JCheckBox("Hop to P2P worlds");
        Object[] checklist = {"Please check what you wish to purchase", deathCheck, firePackCheck, waterPackCheck,
                airPackCheck, earthPackCheck, mindPackCheck, chaosPackCheck, hopP2P};
        if (JOptionPane.showConfirmDialog(null, checklist, "Settings", JOptionPane.OK_CANCEL_OPTION)
                == JOptionPane.OK_OPTION) {
            this.buyDeaths = deathCheck.isSelected();
            this.buyFirePack = firePackCheck.isSelected();
            this.buyWaterPack = waterPackCheck.isSelected();
            this.buyAirPack = airPackCheck.isSelected();
            this.buyEarthPack = earthPackCheck.isSelected();
            this.buyMindPack = mindPackCheck.isSelected();
            this.buyChaosPack = chaosPackCheck.isSelected();
            this.hoppingP2P = hopP2P.isSelected();
        } else
            return false;
        return true;
    }

    private boolean tradeAubury() {
        NPC Aubury = npcs.closest(637);
        if (Aubury != null)
            Aubury.interact("Trade");
        return true;
    }

    private boolean buyRunes(Boolean buyDeaths) {
        RS2Widget deathsRunes = getWidgets().get(300, 2, 8);
        RS2Widget firePacks = getWidgets().get(300, 2, 9);
        RS2Widget waterPacks = getWidgets().get(300, 2, 10);
        RS2Widget airPacks = getWidgets().get(300, 2, 11);
        RS2Widget earthPacks = getWidgets().get(300, 2, 12);
        RS2Widget mindPacks = getWidgets().get(300, 2, 13);
        RS2Widget chaosPacks = getWidgets().get(300, 2, 14);
        RS2Widget close = getWidgets().get(300, 1, 11);
        if (deathsRunes != null && firePacks != null && waterPacks != null
                && airPacks != null && earthPacks != null && mindPacks != null && chaosPacks != null) {
            //Buy DeathRunes
            if (buyDeaths) {
                while (deathsRunes.getItemAmount() > 3) {
                    log(deathsRunes.getItemAmount() + "on store buying deaths");
                    deathsRunes.interact("Buy 10");
                }
            }
            //Buy FirePacks
            if (buyFirePack) {
                while (firePacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        firePacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
            //Buy WaterPacks
            if (buyWaterPack) {
                while (waterPacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        waterPacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
            //Buy AirPacks
            if (buyAirPack) {
                while (airPacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        airPacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
            //Buy EarthPacks
            if (buyEarthPack) {
                while (earthPacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        earthPacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
            //Buy MindPacks
            if (buyMindPack) {
                while (mindPacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        mindPacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
            //Buy ChaosPacks
            if (buyChaosPack) {
                while (chaosPacks.getItemAmount() > random(3, 10)) {
                    for (int i = 1; i <= 3; i++) {
                        chaosPacks.interact("Buy 10");
                    }
                    close.interact("Close");
                    return true;
                }
            }
        }
        close.interact("Close");
        return false;
    }

    private boolean unpackRunes() {
        Inventory i = getInventory();
        while (i.getItem("Fire rune pack") != null) {
            i.getItem("Fire rune pack").interact("Open");
        }
        while (i.getItem("Water rune pack") != null) {
            i.getItem("Water rune pack").interact("Open");
        }
        while (i.getItem("Air rune pack") != null) {
            i.getItem("Air rune pack").interact("Open");
        }
        while (i.getItem("Earth rune pack") != null) {
            i.getItem("Earth rune pack").interact("Open");
        }
        while (i.getItem("Mind rune pack") != null) {
            i.getItem("Mind rune pack").interact("Open");
        }
        while (i.getItem("Chaos rune pack") != null) {
            i.getItem("Chaos rune pack").interact("Open");
        }
        return true;
    }

    private boolean hoppingNow() {
        if (this.hoppingP2P)
            getWorlds().hopToP2PWorld();
        else
            getWorlds().hopToF2PWorld();
        return true;
    }

    @[member=Override]
    public void onStart() {
        this.setCurrentState(States.Idle);
        while (!this.settingsGUI())
            this.settingsGUI();
    }

    @[member=Override]
    public int onLoop() throws InterruptedException {
        //Check cash stack
        if (chatbox.getMessages(Chatbox.MessageType.GAME).contains("You don't have enough coins."))
            this.stop();
        //Are we idling?
        switch (this.getCurrentState()) {
            case Idle:
                if (this.tradeAubury())
                    this.setCurrentState(States.Trading);
                break;
            case Trading:
                if (this.buyRunes(this.buyDeaths)) {
                    this.setCurrentState(States.Unpacking);
                } else {
                    this.setCurrentState(States.Hoping);
                }
                break;
            case Unpacking:
                if (unpackRunes()) {
                    this.setCurrentState(States.Idle);
                }
                break;
            case Hoping:
                if (this.hoppingNow())
                    this.setCurrentState(States.Idle);
                break;
        }
        return random(600, 900);
    }

    @[member=Override]
    public void onExit() {
        log("L4zyRunes got too lazy.");
    }

    @[member=Override]
    public void onPaint(Graphics2D g) {
    }

}

Enjoy

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.