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.

Sample Code

Featured Replies

Saw a post by @faintdrugs and decided to make something because I had a moment.

Don't know if anything's wrong with it, if anyone sees a mistake feel free to call me out.

 

Some Example Code:

import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.map.PolygonArea;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;


/**
 * Created by ~Anon on 31/03/2015.
 */

@ScriptManifest(author = "~Anon", name = "Ash Picker", version = 0.1, info = "Picks Up And Banks Ashes!", logo = "")
public class Ashes  extends Script{
    final PolygonArea ZONE = new PolygonArea(/*tiles boardering area*/);
    String lastLoggedStatus = " ";
    String Status = " ";
    private enum States{
        PICK, BANK;
    }

    @Override
    public void onStart() throws InterruptedException {
        log("Welcome To "+getAuthor()+"'s Ash Picker!");
        if(!ZONE.contains(myPlayer())){
            log("Please Start in ZONE!");
            stop(false);
        }
    }


    @Override
    public int onLoop() throws InterruptedException {
        printStatus();
        switch (getState()){
            case BANK:
                Status = "Banking.";
                doBanking();
                break;
            case PICK:
                Status = "Picking.";
                doPicking();
                break;
        }

        return random(250, 500);
    }

    private States getState(){
        if(inventory.isFull()){
            return States.BANK;
        }else{
            return States.PICK;
        }
    }

    private void doBanking() throws InterruptedException {
        if(!bank.isOpen()){
            Status = "Banking: Opening Bank.";
            NPC banker = npcs.closest("Banker");
            if(banker != null) {
                if (banker.isOnScreen()) {
                    Status = "Banking: Interacting Banker.";
                    banker.interact("Bank");
                    sleep(random(500, 900));
                } else {
                    Status = "Banking: Locating Banker.";
                    if (banker.getPosition().distance(myPosition()) > 6) {
                        localWalker.walk(banker);
                    } else {
                        camera.toEntity(banker);
                    }
                }
            }
        }else{
            Status = "Banking: Depositing.";
            bank.depositAll();
          sleep(random(250, 450));
        }
    }

    private void doPicking() throws InterruptedException {
        if(bank.isOpen()){
            Status = "Picking: Closing Bank.";
            bank.close();
        }else{
            GroundItem ashes = groundItems.closest(new Filter<GroundItem>() {
                @Override
                public boolean match(GroundItem groundItem) {
                    return groundItem != null && groundItem.getName().equals("Ashes") && ZONE.contains(groundItem);
                }
            });
            if(ashes != null){
                if(ashes.isOnScreen()){
                    Status = "Picking: Picking Up Ashes.";
                    ashes.interact("Take");
                    sleep(random(500, 900));
                }else{
                    Status = "Picking: Locating Ashes.";
                    if(ashes.getPosition().distance(myPosition())> 6){
                        localWalker.walk(ashes);
                    }else{
                        camera.toEntity(ashes);
                    }
                }
            }
        }
    }

    private void printStatus(){
        if(lastLoggedStatus != Status){
            log("Current Status: " + Status);
            lastLoggedStatus = Status;
        }
    }
}


Note: I'm used to coding everything in the main loop and did my best to convert the code to a more manageable style for newer people

Edited by Isolate

Looking at someone's source code is always helpful for new scriptwriters :)

Damn you went hard with this tongue.png the basic one I wrote him was like 2 lines of code

Everything seems fine although what's with the messy formatting?

 

Okay i have to ask, where is your signature from?

 

  • Author

Damn you went hard with this tongue.png the basic one I wrote him was like 2 lines of code

 

Safe*

Everything seems fine although what's with the messy formatting?

I'm a messy guy

  • 3 weeks later...
  • Author

Hey, could u help me out with my script?

 

Much appreciated!

Of Course!  Sorry I had to rush off and do something. Did you want to add my skype 'isolatepb' or message me on the forums?

  • 3 weeks later...

Create an account or sign in to comment

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.