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.

Using Multiple Classes

Featured Replies

Hi everyone,

I need to know how to use multiple classes. I'm creating a little quester. 

I have a main class with the onloop() and i have a class for the cooks assistent quest called cookassistent. I want to script the whole procedure of cooks assistent in that class. How would i do that?

the simplest way to do this is to extend MethodProvider:

class MyScriptStep extends MethodProvider {
    public void run() {
        getObjects().getAll()...; // Use OSBot API as you would in main script class
    }
}

Then in your script you would do

class MyScript extends Script {
    // Define the MyScriptStep object
    private MyScriptStep scriptStep = new MyScriptStep();
    // ...
    @Override
    public void onStart() {
        scriptStep.exchangeContext(getBot()); // Configure the MethodProvider to use this bot
    }
    // ...
    public int onLoop() {
        if (someCondition) {
            scriptStep.run(); // Run the step
        }
    }
}

 

  • Author

Hey @Lemons

Thank you for your quick reply! It worked like a charm :).

Would this be the same method for a GUI class?

 

EDIT:: Created a GUI the same way as you told me without extending the MethodProvider :) Thanks again dud.

Edited by Sebastian

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.