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.

Multiple classes :doge:

Featured Replies

package trumpbitch;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import trumpbitch.Woodcutting;

@ScriptManifest(name = "trumpscape", author = "trump", version = 6.9, info = "trump", logo = "trump")
public class Main extends Script {

    @Override
    public void onStart() {
        // nothing cause trump
    }

    @Override
    public int onLoop() {
        Woodcutting.cutTree(this);
        return 100;
    }

}
package trumpbitch;

import org.osbot.rs07.script.Script;

public class Woodcutting {

    public void cutTree(Script script) {
        script.log("trump for pres");
        // insert just the tip
    }

}

this way is pretty much the same thing but i find it's easier to copy paste to new scripts this way. good luck

 

It's not a good idea to have multiple instances of Script, just keep it a subclass of the Main or if you use Nodes, use your Main's superclass (that certain Script instance) as the Script instance for your other class.

It's not a good idea to have multiple instances of Script, just keep it a subclass of the Main or if you use Nodes, use your Main's superclass (that certain Script instance) as the Script instance for your other class.

 

Why is it a bad idea? I haven't had an issue with it yet.

 

Why is it a bad idea? I haven't had an issue with it yet.

 

Script is a type of instance that should only be done once. It's very unlikely to run into problems since we're not dealing with anything that will cause that but think of it this way. When you make a class for methods that needs Script, you're not going to inherit a brand new instance of what your main class has, you want something to 'show' that it's not the main class, hence using the main class' Script instance or using your main class itself.

 

It's 7am and I haven't slept so I may not be explaining it properly, if someone can pitch in that would help. :)

Script is a type of instance that should only be done once. It's very unlikely to run into problems since we're not dealing with anything that will cause that but think of it this way. When you make a class for methods that needs Script, you're not going to inherit a brand new instance of what your main class has, you want something to 'show' that it's not the main class, hence using the main class' Script instance or using your main class itself.

 

It's 7am and I haven't slept so I may not be explaining it properly, if someone can pitch in that would help. smile.png

 

I thought the method I was using was just using the Script class inherited in the main class (extends Script). The Scripts in the other classes are only used as parameters and aren't other instances?

 

Edited by Shiny

I thought the method I was using was just using the Script class inherited in the main class (extends Script). The Scripts in the other classes are only used as parameters and aren't other instances?

 

In other classes they're almost always initiated from your main class, for example you have a node that passes a Script parameter.

 

So you do Banking banking = new Banking(this);

 

This refers to the superclass of the class you call it in (the main class) so the superclass is (Script).

 

Am I making sense rn?

Well, it's a good thing I have this here thread for that there point you're making.

 

And 'one of'.

Saying I know about Java doesn't necessarily imply I can list every single function and know exactly what to do in every situation without outside assistance either.

 

Regardless of what knowledge you have on the topic, you don't understand something until all of the common factors are understood together. Without that, you are literally just putting pieces together, hoping it turns out right.

 

Also, one of my previous posts was intended to expand on information already provided to you. With that being said, I have no reason to insist your level of programming in this case.

Edited by Bitshift

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.