SubCZ 283 Share Posted July 10, 2020 I'm trying to connect to a locally run Redis Server from within my script to fetch machine learning solutions. I tested the connection and server in a standalone Java application and it works as expected, but when I try to establish the connection from within my script in the onStart() or onLoop() hooks, the script gets stuck trying to connect without throwing an exception. Is there some part of Dreambot that is preventing outgoing connections? I am not using a proxy and am currently using the free version of Dreambot to test it. I'm using the Jedis API to connect to the Redis server. Code below, although this exact code works when run from the main method of a standalone Java application: public int onLoop() { if(!connected) { log("Connecting..."); try { Jedis jedis = new Jedis(IP); log("Successfully connected to Server."); log("PING: " + jedis.ping()); jedis.close(); } catch(Exception e){ StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); String exceptionAsString = sw.toString(); log(exceptionAsString); } } return 1000; } Link to comment Share on other sites More sharing options...
yeeter 528 Share Posted July 11, 2020 40 minutes ago, SubCZ said: I'm trying to connect to a locally run Redis Server from within my script to fetch machine learning solutions. I tested the connection and server in a standalone Java application and it works as expected, but when I try to establish the connection from within my script in the onStart() or onLoop() hooks, the script gets stuck trying to connect without throwing an exception. Is there some part of Dreambot that is preventing outgoing connections? I am not using a proxy and am currently using the free version of Dreambot to test it. I'm using the Jedis API to connect to the Redis server. Code below, although this exact code works when run from the main method of a standalone Java application: public int onLoop() { if(!connected) { log("Connecting..."); try { Jedis jedis = new Jedis(IP); log("Successfully connected to Server."); log("PING: " + jedis.ping()); jedis.close(); } catch(Exception e){ StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); String exceptionAsString = sw.toString(); log(exceptionAsString); } } return 1000; } If you are using maven build an uber/shadded/fat jar to bundle the depenencies with it. Otherwise you need to create a /lib folder in your Dreambot folder and include the jars there. Hmu if its still fucked. If you aren't using maven here are a couple resources if you want to use it to manage deps/build your scripts Dreambot Maven Submodules as scripts setup -> https://github.com/yeetware/DB-Maven Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.