Jump to content

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


moeotterson

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

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