Alek Posted April 7, 2018 Share Posted April 7, 2018 Download Link: https://osbot.org/devbuilds/osbot 2.5.4.jar I've been getting a lot of questions about this lately and it seems that there's confusion over how loading resources works. Java is a little tricky when it comes to this as loading resources from a jar is different than loading resources that are not in a jar. I've went ahead and wrote some methods to make everyone's lives a bit easier, so you can write the same code no matter if its an SDN script, a Jar script, Zip script, or just the class files. Script getScriptResourceAsStream - This loads resources relative to the entry of the script Script getDataResourceAsStream - This loads resources relative to the entry of the OSBot data directory Here are two examples so you get an idea: Of course please ensure you are still following the existing SDN resources folder rules. This is an experimental build, please let me know if this helps. 10 1 1 Link to comment
Kid Lethal Posted April 8, 2018 Share Posted April 8, 2018 Awesome, thanks a bunch! 1 Link to comment
Apaec Posted April 8, 2018 Share Posted April 8, 2018 Woohoo!!!! Thanks for this. Just downloaded and tested the build, both SDN resource loading and local resource loading are working once again, and the new getScriptResourceAsStream is handy. Cheers<3 1 Link to comment
ThatGamerBlue Posted April 8, 2018 Share Posted April 8, 2018 me love you long time mr alek Link to comment
Alek Posted April 8, 2018 Author Share Posted April 8, 2018 7 hours ago, Apaec said: Woohoo!!!! Thanks for this. Just downloaded and tested the build, both SDN resource loading and local resource loading are working once again, and the new getScriptResourceAsStream is handy. Cheers<3 Thanks for confirming, I spent more time into this than Id like to admit. 2 Link to comment