September 25, 201510 yr 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); if anyone has a idea, please let me know:) cheers
September 25, 201510 yr 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 September 25, 201510 yr by Joseph
September 25, 201510 yr What is that thing, an osbuddy feature or something? Better off checking the items in your inventory compared to overlays
September 25, 201510 yr 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 September 25, 201510 yr by Daviyow
September 25, 201510 yr Author how come i'm getting a nullpointer on RS2Widget Absorbpts.. 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 September 25, 201510 yr by Daviyow
September 25, 201510 yr how come i'm getting a nullpointer on RS2Widget Absorbpts.. 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.
September 25, 201510 yr 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 September 25, 201510 yr by Daviyow
September 25, 201510 yr 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
September 25, 201510 yr 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 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
September 25, 201510 yr what i dont get is, its saying that these are giving npe's 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());
September 25, 201510 yr what i dont get is, its saying that these are giving npe's 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
September 26, 201510 yr 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);", 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
September 26, 201510 yr 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.
September 26, 201510 yr 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);", what is it trying to say? is the string still nulled? doesn't this say, if absorbpts is null, make it -1 ? thanks again 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.
September 26, 201510 yr 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 202,1,9 if i've been to nmz and drank one, it shows this if i just login, it shows this 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