Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Using external Jars with Script


    ndsalem12

    Recommended Posts

    Hi, so basically I am reaching out because I have recently tried connecting to mySQL database on my script. Even though I have added the mysql jar into the external libraries, I get an error saying that the jar isn't present when running on DreamBot. I know that it isn't my code because I have used the same code for a program that I have ran on eclipse. If anyone can help that would be great! 

    Link to comment
    Share on other sites

    Just now, ndsalem12 said:

    Hi, so basically I am reaching out because I have recently tried connecting to mySQL database on my script. Even though I have added the mysql jar into the external libraries, I get an error saying that the jar isn't present when running on DreamBot. I know that it isn't my code because I have used the same code for a program that I have ran on eclipse. If anyone can help that would be great! 

    Also, not planning on posting the script to SDN, this is for private use. 

    Link to comment
    Share on other sites

    10 hours ago, Nuclear Nezz said:

    You need to include a libs file in the root location of your jar, every jar you're using you need to put the name on a line, to avoid scripts loading 300 libs they don't need.

    Do you mind explaining how to do so? I am a fairly new scripter and this is one of my most ambitious projects using multiple external libraries. 

     

    17 hours ago, Pseudo said:

    Try compiling the SQL files within your scripts folder. 

    Have absolutely no idea how to do that, my script is one file that contains everything such as connecting to the database and performing the actions of the script. If you could explain further I would appreciate it! Thanks for the response as well!

    Link to comment
    Share on other sites

    32 minutes ago, ndsalem12 said:

    Do you mind explaining how to do so? I am a fairly new scripter and this is one of my most ambitious projects using multiple external libraries. 

     

    Have absolutely no idea how to do that, my script is one file that contains everything such as connecting to the database and performing the actions of the script. If you could explain further I would appreciate it! Thanks for the response as well!

    Okay so you just need to make a file just under the src directory.
    You're gonna call it libs, this isn't a text file or anything, just a normal File, you can right click the src folder->new file, name it libs
    Then you put the names of the jars you're using in the libs folder, in your libs file.
    eg:
    json-simple-1.1.1.jar
    my-other-api.jar

    and that's it, rebuild it, if it's still not working open up your jar and make sure the file is there.

    As for the building into your script, that's an option in your IDE to build the source of a dependency into your output jar.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.