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
  • Try asking for help in the chatbox
  • Using external Jars with Script


    ndsalem12
     Share

    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

    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
     Share

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