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.

Little question

Featured Replies

Hi, im trying to get values from this widget here, and i have a question how i need to do that, because i need to use lower than and higher than, and with this i can only use Equals, im currently using this:

 

RS2Widget absPts = widgets.get(202, 9);

 

 

306c50d4a1.jpg

 

if anyone has a idea, please let me know:)

 

cheers

Open up widget debugger. Use the widget you want to Debug. See if it give you the value maybe in the message, or tool tip, idk just look through the debug for the value

Edited by Joseph

What is that thing, an osbuddy feature or something?

 

Better off checking the items in your inventory compared to overlays

  • Author

Open up widget debugger. Use the widget you want to Debug. See if it give you the value maybe in the message, or tool tip, idk just look through the debug for the value

 

 

nvm thanks man i used this to convert the stringto a int

 

        RS2Widget 1 = widgets.get(x, x,x);

        String abbysorby = 1.getMessage();

        int absPts = Integer.valueOf(abbysorby);

Edited by Daviyow

  • Author

how come i'm getting a nullpointer on RS2Widget Absorbpts..

 

bf46590e7e.png

 

before i use absPts in any states in my getState i nullcheck Absorbpts & abbysorby, and i can't seem to nullcheck absPts any ideas why? can't figure it out

Edited by Daviyow

how come i'm getting a nullpointer on RS2Widget Absorbpts..

 

bf46590e7e.png

 

before i use absPts in any states in my getState i nullcheck Absorbpts & abbysorby, and i can't seem to nullcheck absPts any ideas why? can't figure it out

 

The NPE is probably thrown in your getState method when the widget is unavailable.

 

  • Author

The NPE is probably thrown in your getState method when the widget is unavailable.

 

 

 

is there a easier way to collect the widget message and use the value as a int? can't get out of this it just keeps giving npe no matter what i try,

Edited by Daviyow

is there a easier way to collect the widget message and use the value as a int? can't get out of this it just keeps giving npe no matter what i try,

 

I don't think so. Just check your nulls properly and you'll be fine :E

  • Author

I don't think so. Just check your nulls properly and you'll be fine :E

 

what i dont get is, its saying that  these are giving npe's

88d3831155.png

 

even if im not using any of those methods, i can't nullcheck these right? its so confusing wow lol didn't do this in a looooong time

what i dont get is, its saying that  these are giving npe's

88d3831155.png

 

even if im not using any of those methods, i can't nullcheck these right? its so confusing wow lol didn't do this in a looooong time

 

 

String abbysorby = (Absorbpts == null ? "-1" : Absorbpts.getMessage());

what i dont get is, its saying that  these are giving npe's

88d3831155.png

 

even if im not using any of those methods, i can't nullcheck these right? its so confusing wow lol didn't do this in a looooong time

 

Widgets#get(int, int, int) will return null if the widget is not found. So when you call getMessage on a null reference, you get an NPE

  • Author

thanks for the replies & help, really appreciate it :), i've replaced it and now im getting one more error, the last line, " absPts = Integer.valueOf(abbysorby);",

 

8187bf4785.png

 

what is it trying to say? is the string still nulled?

 

 

String abbysorby = (Absorbpts == null ? "-1" : Absorbpts.getMessage());

 

doesn't this say, if absorbpts is null, make it -1 ?

 

thanks again :)

Integer.valueof is not the way to convert a string into an int.

Null check the widget before grabbing it's message.

Yes to the question above me.

thanks for the replies & help, really appreciate it smile.png, i've replaced it and now im getting one more error, the last line, " absPts = Integer.valueOf(abbysorby);",

 

8187bf4785.png

 

what is it trying to say? is the string still nulled?

 

 

doesn't this say, if absorbpts is null, make it -1 ?

 

thanks again smile.png

 

The exception is telling you that the message of the widget is empty ("" in other words). So you probably have the incorrect widget; or the number was never in the message field of the widget in the first place. Try using the widget value debugger to find the correct widget/field.

 

  • Author

The exception is telling you that the message of the widget is empty ("" in other words). So you probably have the incorrect widget; or the number was never in the message field of the widget in the first place. Try using the widget value debugger to find the correct widget/field.

 

 

pretty sure i have the correct widget :s 202,1,9

 

if i've been to nmz and drank one, it shows this

 

c566f5f4ab.png

 

if i just login, it shows this

97c1369e2f.png

 

so i need to somehow nullcheck the widget but its already been done by

String abbysorby = (Absorbpts == null ? "-1" : Absorbpts.getMessage());

? thanks for all the help btw :)

fixed it, i changed

String abbysorby = (Absorbpts == null ? "-1" : Absorbpts.getMessage());

to

String abbysorby = (!Absorbpts.isVisible() ? "0" : Absorbpts.getMessage());

thanks for all the help appreciate it :)!

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.