Jump to content
Sign in to follow this  
Secret

NullPointer using Skills.getCurrentLevel

Recommended Posts

Hey Guys,

I recently made my first fully functioning script. It works great, there is only 1 issue that I can see, and it happens super randomly. I have had run times of around 3 hours with this script before it happens, and I have had run times closer to 10-15 mins before it happens.

Here is the stack that is being produced:

exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

 

It continuously repeats that error in my console. On top of that, it freezes the entire xobot client.

 

Here is the line of code it is blowing up on:
 

if(Skills.CONSTITUTION.getCurrentLevel() < eatAt) {

If anyone has any idea what's going on, I would appreciate some insight. :)

 

Thanks!
~Secret

Share this post


Link to post
Share on other sites
3 hours ago, secretlife said:

Hey Guys,

I recently made my first fully functioning script. It works great, there is only 1 issue that I can see, and it happens super randomly. I have had run times of around 3 hours with this script before it happens, and I have had run times closer to 10-15 mins before it happens.

Here is the stack that is being produced:


exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

exception caught: java.lang.NullPointerException
        at xobot.script.methods.tabs.Skills.getCurrentLevel(za:167)
        at SecretMasterFarmer.loop(SecretMasterFarmer.java:108)
        at xobot.IiIiIiiiIi.ALLATORIxDEMO(ta:164)
        at xobot.IiIiIiiiIi.run(ta:145)
        at java.lang.Thread.run(Unknown Source)

 

It continuously repeats that error in my console. On top of that, it freezes the entire xobot client.

 

Here is the line of code it is blowing up on:
 


if(Skills.CONSTITUTION.getCurrentLevel() < eatAt) {

If anyone has any idea what's going on, I would appreciate some insight. :)

 

Thanks!
~Secret

How are you declaring and initializing eatAt? NullPointerException happens when you are trying to use an object without initializing it

Share this post


Link to post
Share on other sites
13 hours ago, Casual said:

How are you declaring and initializing eatAt? NullPointerException happens when you are trying to use an object without initializing it

It's initialized private int eatAt = 0; Then is set from the GUI.

If that were the issue, I would expect it would not run at all. It's only modified from the GUI when first running the script. I certainly wouldn't expect to have run times with the script of around 3 hours, and others only 10 mins. I think it's an issue with the API call to the Skills.getCurrentLevel.

The other weird thing for me is that I have this in a try catch block, which is what printed that error. Regardless, it still freezes the client up. Either or this stack trace is a result of the client freezing itself.

Share this post


Link to post
Share on other sites
28 minutes ago, secretlife said:

It's initialized private int eatAt = 0; Then is set from the GUI.

If that were the issue, I would expect it would not run at all. It's only modified from the GUI when first running the script. I certainly wouldn't expect to have run times with the script of around 3 hours, and others only 10 mins. I think it's an issue with the API call to the Skills.getCurrentLevel.

The other weird thing for me is that I have this in a try catch block, which is what printed that error. Regardless, it still freezes the client up. Either or this stack trace is a result of the client freezing itself.

Might be issues with the api call but I never had that problem occur. Maybe @Neo can chip in.

Share this post


Link to post
Share on other sites

I'm open to hearing anything. The sequence is more that the client freezes and then that stack starts printing in the console. So it is possible that there isn't an issue with the API, rather the client freezing which makes any call to get information return null.

Share this post


Link to post
Share on other sites

Skills.ATTACK.getCurrentLevel

Use latest API jar to compile your script

Share this post


Link to post
Share on other sites
5 hours ago, Neo said:

Skills.ATTACK.getCurrentLevel

Use latest API jar to compile your script

@Neo Yeah, I just downloaded the jar again to make sure I had the latest. 

This is the method I am using: 

Skills.CONSTITUTION.getCurrentLevel()

 

I had one run today where it was almost 2 hours, now anything after that one the client will freeze roughly 20-30 mins in. Sometimes less time than that.

Share this post


Link to post
Share on other sites
16 minutes ago, SpaceX said:

Post your script so others can try and debug.

Swear I am not trying to be a prude here. It's nearly a complete script, that works when the client runs (so minus this issue). I would PM it to @Neo if he wanted to see it... but I don't want this ruined until I am done with the area. I plan to release it after I get my use out of it, so ban rates won't affect me.

For background, it is a thieving script. Which has the highest ban rate on Alora.

Share this post


Link to post
Share on other sites
Just now, secretlife said:

Swear I am not trying to be a prude here. It's nearly a complete script, that works when the client runs (so minus this issue). I would PM it to @Neo if he wanted to see it... but I don't want this ruined until I am done with the area. I plan to release it after I get my use out of it, so ban rates won't affect me.

For background, it is a thieving script. Which has the highest ban rate on Alora.

That being said, before I release it... I will have more added in terms of anti ban, so each user will have the script run slightly different.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×