Jump to content

Error on start up [Help]


whipz

Recommended Posts

Hey guys, 

I have started writing my own script; I have most of it finished I think; I have created the .jar, I also can see it now on the script selector; However this is as far as I can get;

When i click run my GUI opens which is perfect however the client then lags like crazy and wont let me click or even close osbot down unless i task manage it and end the java task. 

I opened the logger first this time and it gave me this error

 

 
error in script executor! 
java.lang.NullPointerException
 
at main.getState(main.java50)
at main.onLoop(main.java 59)
at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(hk:274)
at java.lang.Thread.run(Unknown Source)

 

So i think my errors are here ? 

line 50

if (!inventory.contains(rawName) && !bankArea.contains(myPlayer()))

 

line 59

 

switch (getState()) {

 

Any help will be appreciated;

 

Also i can post more of the code if needed

Link to comment
Share on other sites

rawName returns null, probably because you dont set it in your gui untill you click a button. You could just instantiate the variable by just doing String rawName = "". Albeit thats a bad practice IMO. So you should look into how to make your script wait untill the gui is closed.

http://osbot.org/forum/topic/91963-using-synchronized-to-your-advantage/

Also you can watch my tutorial series if you want to do tasks or better states, I upload new tutorials weekly.

http://osbot.org/forum/topic/114013-tutorial-seriesvideo-scripting-made-easy-with-in-depth-explanations/

Edited by Vilius
  • Like 1
Link to comment
Share on other sites

rawName returns null, probably because you dont set it in your gui untill you click a button. You could just instantiate the variable by just doing String rawName = "". Albeit thats a bad practice IMO. So you should look into how to make your script wait untill the gui is closed.

http://osbot.org/forum/topic/91963-using-synchronized-to-your-advantage/

Also you can watch my tutorial series if you want to do tasks or better states, I upload new tutorials weekly.

http://osbot.org/forum/topic/114013-tutorial-seriesvideo-scripting-made-easy-with-in-depth-explanations/

 

 

Looking over it now thanks (: will post again if I get stuck

rawName returns null, probably because you dont set it in your gui untill you click a button. You could just instantiate the variable by just doing String rawName = "". Albeit thats a bad practice IMO. So you should look into how to make your script wait untill the gui is closed.

http://osbot.org/forum/topic/91963-using-synchronized-to-your-advantage/

Also you can watch my tutorial series if you want to do tasks or better states, I upload new tutorials weekly.

http://osbot.org/forum/topic/114013-tutorial-seriesvideo-scripting-made-easy-with-in-depth-explanations/

 

I still get a similar error, However I can now use the GUI fine, Once I click start; It gives me this error now

 

java.lang.NUllPointerException
at main.getstate(main.java:55)
at main.onLoop(main.java:64)
at org.osbot.rs07.eventScriptExecutor$InternalExecutor.run(hk:274)
at java.lang.Thread.run(Unknown Source)

 

Its the exact same lines; However my rawName should be declared once okay is pressed.

Link to comment
Share on other sites

Looking over it now thanks (: will post again if I get stuck

I still get a similar error, However I can now use the GUI fine, Once I click start; It gives me this error now

java.lang.NUllPointerExceptionat main.getstate(main.java:55)at main.onLoop(main.java:64)at org.osbot.rs07.eventScriptExecutor$InternalExecutor.run(hk:274)at java.lang.Thread.run(Unknown Source)
Its the exact same lines; However my rawName should be declared once okay is pressed.
Lines seem to be changes unless you just formatted your code and the line is the same then either your area is null and or myPlayer returns null. If the latter then you would need to be logged in. Edited by Vilius
  • Like 1
Link to comment
Share on other sites

Lines seem to be changes unless you just formatted your code and the line is the same then either your area is null and or myPlayer returns null. If the latter then you would need to be logged in.

 

Just formated code and added your lock thingy;

 

exact same lines of code /:

 

Still getting the same errors; I dunno what is wrong; 

Edited by whipz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...