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.

Running Local Scripts

Featured Replies

Do you need VIP to run local scripts, because my scripts onLoop doesn't seem to execute? I can run the script, and the onStart log outputs, but the onLoop doesn't?

no you don't need VIP to run local scripts, probably something in the code you wrote

Edited by Spider

Check the scope of your onloop in the class file or if you're relying on conditional execution that the criteria is being met?

  • Author
33 minutes ago, Aftermath said:

Check the scope of your onloop in the class file or if you're relying on conditional execution that the criteria is being met?

import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;

@ScriptManifest(name = "ScriptTest", author = "Jar", version = 1.0, info = "", logo = "")

public class ScriptTest extends Script {

    @Override

    public void onStart() {

        log("ScriptTest has started!");

    }

    @Override

    public void onExit() {

        log("ScriptTest has ended!");

    }

    @Override

    public int onLoop() {
        log("started loop");

        return 100; //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)

    }

}

I wasn't sure if I had to execute onLoop by calling it in onStart, but then every script I've seen doesn't do that, it just simply writes tasks within onLoop & they're executed simultaneously.

 

Edited by Jar

1 hour ago, Jar said:

import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;

@ScriptManifest(name = "ScriptTest", author = "Jar", version = 1.0, info = "", logo = "")

public class ScriptTest extends Script {

    @Override

    public void onStart() {

        log("ScriptTest has started!");

    }

    @Override

    public void onExit() {

        log("ScriptTest has ended!");

    }

    @Override

    public int onLoop() {
        log("started loop");

        return 100; //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)

    }

}

I wasn't sure if I had to execute onLoop by calling it in onStart, but then every script I've seen doesn't do that, it just simply writes tasks within onLoop & they're executed simultaneously.

 

 
 

You're correct, no need to execute onLoop through onStart, it handles it by itself.

Are you sure that you're running the correct output file (not sure if you've maybe made changes)? I've run exactly what you posted and it is logging the loop output.

Edited by Aftermath

  • Author
13 minutes ago, Aftermath said:

You're correct, no need to execute onLoop through onStart, it handles it by itself.

Are you sure that you're running the correct output file (not sure if you've maybe made changes)? I've run exactly what you posted and it is logging the loop output.

I forgot to refresh my scripts in the selector ?

 

Thanks for your time & help though :).

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.