moeotterson Posted January 11, 2018 Share Posted January 11, 2018 Some people mentioned earlier that it is possible add GSON or similar libraries using tricks to get around client permissions. If you could give me a step-by-step guide for intelliJ or Eclipse and post a time and place, I will be there to suck your dick. I would love to get around using SimpleJSON because I can't for the life of me get it to read a local .json file I generate. Also, I have SimpleJSON working to generate a local .json file of data that I want to store. However, when I want to read the file I can't seem to debug a null pointer exception even though I've verified the bot sees the file and is in the right directory. If anyone has a snippet of code they got to work to read a .json file, time-place-dicksucking etc... Quote Link to comment Share on other sites More sharing options...
Explv Posted January 12, 2018 Share Posted January 12, 2018 (edited) 1 hour ago, moeotterson said: Some people mentioned earlier that it is possible add GSON or similar libraries using tricks to get around client permissions. If you could give me a step-by-step guide for intelliJ or Eclipse and post a time and place, I will be there to suck your dick. I would love to get around using SimpleJSON because I can't for the life of me get it to read a local .json file I generate. Also, I have SimpleJSON working to generate a local .json file of data that I want to store. However, when I want to read the file I can't seem to debug a null pointer exception even though I've verified the bot sees the file and is in the right directory. If anyone has a snippet of code they got to work to read a .json file, time-place-dicksucking etc... time-place-dicksucking?????? o.o There are plenty of resources online of how to use the Json simple library. For example: https://www.mkyong.com/java/json-simple-example-read-and-write-json/ Just make sure your Json file is in the OSBot data directory, and you make use of the OSBot getDirectoryData() method. For example: String jsonFile = Paths.get(getDirectoryData(), "yourJsonFile.json").toString(); (Syntax may be wrong, I'm on my phone) Edited January 12, 2018 by Explv Quote Link to comment Share on other sites More sharing options...
moeotterson Posted January 12, 2018 Author Share Posted January 12, 2018 21 hours ago, El_Maestro said: As far as I am aware there is no way around the permissions. The only thing that is possible is to invoke the clients main method using reflection (basically load the osbot client the same way osbot loads the runescape client). In short, I'd recommend using json simple. I ran into the same issue a few days ago. All json and xml libraries that automatically serialize/deserialize objects use reflection to set the field values of the new instance class on deserialization. I went with json simple which will require you to make your own make-shift object serialization/deserialization functionality. PM me on discord if you want help fixing the NPE, I spent a lot of time messing with json simple. Messaged you on forums for details. Quote Link to comment Share on other sites More sharing options...
Explv Posted January 12, 2018 Share Posted January 12, 2018 (edited) @moeotterson It would be helpful if you posted your code and the json file, so we can see what's wrong. Edited January 12, 2018 by Explv Quote Link to comment Share on other sites More sharing options...