Hayase Posted January 29, 2017 Share Posted January 29, 2017 ... @Override public void onPaint(Graphics2D g) { ... /* * If the bot loses connection (got banned?)--take a screenshot */ if (getClient().getLoginStateValue() == 40) {//40 = connection lost log("Client connection lost!"); Utilities.takeScreenshot(); } ... Detecting the last moments of your bot! I've always wondered when and where my bot would get banned. It would be nice to see the last bit of life the bot had before it got banned. This snippet does generate false positives because not all connection losts are bans. The only problem is if you run a lot of bots and are having connection issues--this could potentially generate a lot of disk space. 1 Quote Link to comment Share on other sites More sharing options...
Token Posted January 29, 2017 Share Posted January 29, 2017 You can eliminate the real dc's by checking the login response code you will get immediately after, 4 is for banned, just delete the screenshot you took otherwise since they are in the data folder and you have access to them from within your scripts 4 Quote Link to comment Share on other sites More sharing options...
Hayase Posted February 2, 2017 Author Share Posted February 2, 2017 On 1/29/2017 at 8:17 AM, Token said: You can eliminate the real dc's by checking the login response code you will get immediately after, 4 is for banned, just delete the screenshot you took otherwise since they are in the data folder and you have access to them from within your scripts Oh nice I didn't think of deleting. I'll fix it up :3 Quote Link to comment Share on other sites More sharing options...