Skip 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: Gathering an item off the ground.

Featured Replies

Hey guys I'm working on my first script and have no experience with programming, but am willing to learn!

I want to create a script that picks up items in the area and banks them at the nearest bank. An example being a script that picks up fish dropped at a fishing spot and banks them. Would using a machine state type function work? Such as WAIT, GATHER, BANK? Or is there another method that would work better. I'm working on how the script would identify and pick up the fish but I'm not sure I understand that process correctly. Also in the script how would I specify the item to be picked up? Does that work off of item ID or name? Are there any tricks to better searching through the API? Below is what I have right now, which I'm certain is wrong. Any help would be awesome!

Thanks!


 

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
 
import java.awt.*;
 
@ScriptManifest(author = "AntiCitizen", info = "Grabs fish, banks it in Edgeville.", name = "Fish Snatcher", version = 0, logo = "")
public class main extends Script {
 
    @Override
    public void onStart() {
        log("Start by the fishing spot in Barbarian Village!");
    }
    
   private enum State {
       BANK, GATHER, WAIT
   };
   
   private State getState{} {
       getAll = objects.closest{"Raw salmon, Raw trout");
   }
                           
 
   
  
 

   






 

you need a onLoop and you would need to create a switch-case for your getState()

@Override
    public int onLoop() throws InterruptedException {
        
        switch(getState()){
            case STEAL:
              
                break;
            case DROP:
            
                break;
            case WALK_STALL:
                
                break;
            case POCKET:
                
                break;

        }
        return random(250, 600);

   }

this:

    State getState() {
        if(condition 1) return State.POCKET;


    }

And look through the Inventory and GroundItems API they are helpful tongue.png

 

Example:

        GroundItem g = getGroundItems().closest("");

/**
    remember to null check

**/

Edited by TheObserver

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.