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.

Null pointer with .getZ()

Featured Replies

Edit:

Going to stick with the normal way i code then.

 

your API is silly enough as is, im not changing my whole style for it.

Edited by Isolate

Yes i am logged in

 

add System.out.println(client.myPlayer());System.out.println(client.getPosition());System.out.println(client.getPosition().getZ());

show output

But yh u can always try script.client.getPlane()

  • Author

add System.out.println(client.myPlayer());System.out.println(client.getPosition());System.out.println(client.getPosition().getZ());

show output

But yh u can always try script.client.getPlane()

i'll try that

 

EDIT: nope error still sad.png

Edited by Isolate

i'll try that

 

EDIT: nope error still sad.png

its a null pointer exception so check to see if your player isnt null null checking it plane

You should be using an ArrayList here (while programming to the interface as well):

List<ScriptTask> tasks = new ArrayList<ScriptTask>();

LinkedList orders elements sequentially, so their good when you need to add/remove things. ArrayList on the other hand has faster read access. It's not a big deal here but it's just something I noticed :)

 

As for your actual question, most likely client is returning null because you don't have an instance of it. Actually, on second look that is 100% the issue because you're extending Script in your class which is giving you another instance of script besides the one that was actually initialized. You need to pass the Script instance from your main class to the separate classes you use.

dont let onGround extend script, make a constructor for the onGround and like swizz said initialize it. Use this as an example

  • Author

Going to stick with the normal way i code then.

 

your API is silly enough as is, im not changing my whole style for it.

Edited by Isolate

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.