August 20, 20178 yr Is there anyway to make the script copy all logs like this one into txt file? [INFO][Bot #1][08/21 12:51:53 AM]: WebWalkingEvent; We have reached the final destination! [INFO][Bot #1][08/21 12:51:53 AM]: Current money stock 662459 [INFO][Bot #1][08/21 12:52:00 AM]: Current money stock 662459
August 20, 20178 yr https://stackoverflow.com/questions/15758685/how-to-write-logs-in-text-file-when-using-java-util-logging-logger
August 20, 20178 yr Hmm.. not sure if true but I've heard a couple of times that I/O is blocked by the client.
August 21, 20178 yr 9 hours ago, kadiem said: Is there anyway to make the script copy all logs like this one into txt file? [INFO][Bot #1][08/21 12:51:53 AM]: WebWalkingEvent; We have reached the final destination! [INFO][Bot #1][08/21 12:51:53 AM]: Current money stock 662459 [INFO][Bot #1][08/21 12:52:00 AM]: Current money stock 662459 If it is your own script, just write to a file instead of the logger. If it isn't, you could run the bot via the command line in debug mode using the -debug flag and then redirect the output to a file by using > logfile.txt at the end of the command. java -jar ....... -debug ..... > logfile.txt Edited August 21, 20178 yr by Explv
August 21, 20178 yr Author 6 hours ago, Explv said: If it is your own script, just write to a file instead of the logger. If it isn't, you could run the bot via the command line in debug mode using the -debug flag and then redirect the output to a file by using > logfile.txt at the end of the command. java -jar ....... -debug ..... > logfile.txt It's my script i already tried this : try { File file = new File("Test.txt"); if(!file.exists()) { file.createNewFile(); } PrintWriter pw = new PrintWriter(file); pw.println("Test"); pw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } But it's giving me permission error is there another way?
August 21, 20178 yr 1 minute ago, kadiem said: It's my script i already tried this : try { File file = new File("Test.txt"); if(!file.exists()) { file.createNewFile(); } PrintWriter pw = new PrintWriter(file); pw.println("Test"); pw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } But it's giving me permission error is there another way? You can only create files in the OSBot data directory. The path for this directory can be retrieved using getDirectoryData(), I think it's in the Script class?
August 21, 20178 yr Author 9 minutes ago, Explv said: You can only create files in the OSBot data directory. The path for this directory can be retrieved using getDirectoryData(), I think it's in the Script class? I changed pathname to getDirectoryData()+"Test.txt" and it worked thank you so much!! Edited August 21, 20178 yr by kadiem
Create an account or sign in to comment