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 - populating client, player, etc [answered]

Featured Replies

I'm using multiple classes and I'm struggle with every class using the client and player.

 

Things like

 

client.getMyPlayer()

 

Return null in anything besides my one class.

 

How can I make it so both classes after access to stuff like

 

client.getMyPlayer()

 

and

 

client.moveCameraToEntinty()

 

Without having to write

 

method(Player p)

 

p.getInfo();

 

Both classes import and extend script. I just want both classes to be able to use client.getMyPlayer();

 

Answer: see below TWO posts

Edited by thelegacy0

Your not suppose to extend script for each of your classes, your suppose to create a constructor which extends method provider, you could do it like so:

 

7Vqay.png

 

This will then allow you to access the MethodProvider using "s.client.blah blah"

 

7VqdS.png


Hope that's clear enough for you 

In your constructors of your other classes, include your main class as a parameter (like this):

 

Main Class:

SecondClass secondClass = new SecondClass(this);

SecondClass:

private MainClass class;

public SecondClass(MainClass script) {
     this.script = script;
}
  • Author

Thank you guys, adding (this) to my main class and this.s = s; plus s.client did the trick!

 

Divinity, how do you get your pictures that size? Mine come up microscopic

Guest
This topic is now closed to further replies.

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.