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.

Script compiled but not showing up on local scripts

Featured Replies

Hey guys,I know my scripting skills are very poor, but I am trying to learn.

Yesterday I made a tea stealer from that tutorial, and now I am trying to add banking to it.

Its probably not banking right now, but it should be able to compile properly and show up on my osbot local scripts loader.

All my local scripts show up, except this one. I compiled it with 0 errors or warnings and it is now a jar file in my scripts folder.

I compiled it as a jar file.

 

Quote

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(author = "Reinier", info = "My first script", name = "Tea thiever", version = 0.1, logo = "")
public class tea extends Script {

    public Area bankArea = new Area(3253, 3420, 3254, 3420);
    
    @Override
    public void onStart() {
        log("Welcome to Bank Tea Thiever by Reinier.");
        log("If you experience any issues while running this script please report them to me on the forums.");
        log("Enjoy the script, gain some thieving levels!");
    }

    private enum State {
        STEAL, BANK, WAIT
    };

    private State getState() {
        Entity stall = objects.closest("Tea stall");
        if (!inventory.isEmpty())
            return State.BANK;
        if (stall != null)
            return State.STEAL;
        return State.WAIT;
    }

    @Override
    public int onLoop() throws InterruptedException {
        switch (getState()) {
        case STEAL:
            Entity stall = objects.closest("Tea stall");
            if (stall != null) {
                stall.interact("Steal-from");
            }
            break;
        case BANK:
            getWalking().walk(bankArea);
            if(bankArea.contains(myPlayer()) && inventory.contains("Cup of tea")) {
                log("openBooth()");
                openBooth();
            break;}
        case WAIT:
            sleep(random(500, 700));
            break;
        }
        return random(200, 300);
    }

        public void openBooth() throws InterruptedException {
            Entity bankBooth = getObjects().closest(bankArea, "Closed bankbooth");
            bankBooth.interact("Bank");
            inventory.getItem("Cup of tea").interact("Deposit-All");
            sleep(random(500,1000));
        }
        
    @Override
    public void onExit() {
        log("Thanks for running my Tea Thiever!");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

 

Edited by Thelogs

Your if-statement ends after break

        case BANK:
            getWalking().walk(bankArea);
            if(bankArea.contains(myPlayer()) && inventory.contains("Cup of tea")) {
                log("openBooth()");
                openBooth();
            break;} <-- this is in the wrong spot

Gl my dude, not a scripter but I can tell you are trying your best so I hope someone knowledgeable such as @Juggles or @ProjectPact would be more informative :):doge:

@ScriptManifest(author = "Reinier", info = "My first script", name = "Tea thiever", version = 0.1, logo = "")

In your script manifest, the name will be how it shows up in your local scripts. Make sure it is unique so scripts don't overwrite eachother.

 

23 minutes ago, naaiz said:

@ScriptManifest(author = "Reinier", info = "My first script", name = "Tea thiever", version = 0.1, logo = "")

In your script manifest, the name will be how it shows up in your local scripts. Make sure it is unique so scripts don't overwrite eachother.

 

 


 

41 minutes ago, naaiz said:

@ScriptManifest(author = "Reinier", info = "My first script", name = "Tea thiever", version = 0.1, logo = "")

In your script manifest, the name will be how it shows up in your local scripts. Make sure it is unique so scripts don't overwrite eachother.

 

^

When using IntelliJ, did you set the artifact path to OSBot's folder?

Something that you could forget without knowing.

 

after you build your project in intellij you need to drag the jar file into your scripts folder for osbot then hit refresh on the script loading page.

  • Author
3 hours ago, naaiz said:

@ScriptManifest(author = "Reinier", info = "My first script", name = "Tea thiever", version = 0.1, logo = "")

In your script manifest, the name will be how it shows up in your local scripts. Make sure it is unique so scripts don't overwrite eachother.

 

haha yeah that was it >.< 

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.