Jump to content

Tricks to add external libraries GSON, JSON, Simple-JSON


Recommended Posts

Posted

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...

Posted (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 by Explv
Posted
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.

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
  • Recently Browsing   0 members

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