BobSmokey Posted January 3, 2019 Share Posted January 3, 2019 (edited) String botCommand = "java -jar \"Osbot 2.5.31.jar\" " + "-login " + osbotLogin + " -bot " + bot + " -script " + script + " -world " + world + (extraParams != null ? " " + extraParams : ""); Process pr = rt.exec(botCommand); BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream())); String line; while ((line = input.readLine()) != null) { //if (line.equalsIgnoreCase("Starting script...")) // break; System.out.println(line); } UPDATE: The reason why I want this is to keep track of bots on "-allow lowresource" mode. Is there a better way? Old post: When I run this, the bot client starts and stops before the login handler comes in. I run this from eclipse and when I disconnect the client from eclipse, it continues. if I add the lines that I commented out, then the script does continue. So this while loop is the cause. How do I make this work and still be able to get the output? Thanks in advance Edited January 4, 2019 by BobSmokey formatting Quote Link to comment Share on other sites More sharing options...
dormic Posted January 3, 2019 Share Posted January 3, 2019 (edited) You're trying to get the ouput of the script/bot right? I tried this myself too and it didn't work. There is an option to open a socket with the CLI -debug porthere command and you can listen to this port with for example Python to get the output and store it somewhere. That's how far I got. import socket # creates socket object s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = socket.gethostname() # or just use (host = '') port = 5005 s.connect((host, port)) tm = s.recv(1024) # msg can only be 1024 bytes long s.close() print("the time we got from the server is %s" % tm.decode('ascii')) input("enter") Not sure how to continue, I gave up because I didn't need it anymore after all. Edited January 3, 2019 by dormic 1 Quote Link to comment Share on other sites More sharing options...
BobSmokey Posted January 4, 2019 Author Share Posted January 4, 2019 Is there any other way to keep track of bots on "-allow lowresource" mode? Quote Link to comment Share on other sites More sharing options...
Lordsthan Posted January 5, 2019 Share Posted January 5, 2019 15 hours ago, BobSmokey said: Is there any other way to keep track of bots on "-allow lowresource" mode? Use the debug flag on CLI. Quote Link to comment Share on other sites More sharing options...