whipz Posted January 16, 2017 Share Posted January 16, 2017 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 Quote Link to comment Share on other sites More sharing options...
Vilius Posted January 16, 2017 Share Posted January 16, 2017 (edited) 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 January 16, 2017 by Vilius 1 Quote Link to comment Share on other sites More sharing options...
whipz Posted January 16, 2017 Author Share Posted January 16, 2017 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. Quote Link to comment Share on other sites More sharing options...
Vilius Posted January 16, 2017 Share Posted January 16, 2017 (edited) 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 January 16, 2017 by Vilius 1 Quote Link to comment Share on other sites More sharing options...
whipz Posted January 16, 2017 Author Share Posted January 16, 2017 (edited) 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 January 16, 2017 by whipz Quote Link to comment Share on other sites More sharing options...