Brian Posted April 23, 2020 Share Posted April 23, 2020 (edited) https://pastebin.com/xagtE9jK Very simple script, not sure how I am possibly having something "leak" to cause an increased amount of lag starting from minute 1 until it eventually crashes after 20minutes or so. Note: the if(players.myPlayer().isAnimating()){ log("animating"); if(random(1,30) == 1){ if(random(1,2) == 1){ log("backspace"); getKeyboard().pressKey(8); getKeyboard().releaseKey(8); }else{ log("random letter"); Random r = new Random(); char c = (char)(r.nextInt(26) + 'a'); new TypeStringEvent(Character.toString(c), false); } } } block is the only block ever getting executed during lagging portion. Edited April 23, 2020 by Brian Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted April 23, 2020 Share Posted April 23, 2020 (edited) Mirror mode or stealth? Also what OS you using? I've ran your code for about 10 mins now, on mirror mode. The fps is still at the max amount of 50. Try running simplified blocks, and slowly start adding in more code to see when it starts happening. Edited April 23, 2020 by BravoTaco Quote Link to comment Share on other sites More sharing options...
Protoprize Posted April 23, 2020 Share Posted April 23, 2020 (edited) NVM Just saw the pastebin One thing that I have noticed is that you have a 30 second time out on your conditional sleep? Edited April 23, 2020 by Protoprize Stupidity on my side Quote Link to comment Share on other sites More sharing options...
Brian Posted April 23, 2020 Author Share Posted April 23, 2020 29 minutes ago, BravoTaco said: Mirror mode or stealth? Also what OS you using? I've ran your code for about 10 mins now, on mirror mode. The fps is still at the max amount of 50. Try running simplified blocks, and slowly start adding in more code to see when it starts happening. W10, Mirror Mode. I changed my random method from random(..,..) to ThreadLocalRandom.current().nextInt(..,..+1) And it has seemed to have solved the problem. Very weird 26 minutes ago, Protoprize said: NVM Just saw the pastebin One thing that I have noticed is that you have a 30 second time out on your conditional sleep, I'm pretty sure that has something to do with it That code is never reached, just a failsafe. I removed it and had the same issue. Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted April 23, 2020 Share Posted April 23, 2020 7 minutes ago, Brian said: W10, Mirror Mode. I changed my random method from random(..,..) to ThreadLocalRandom.current().nextInt(..,..+1) And it has seemed to have solved the problem. Very weird Very odd. As the random() method just uses the Random class from java. But atleast its working now Quote Link to comment Share on other sites More sharing options...
Brian Posted April 23, 2020 Author Share Posted April 23, 2020 (edited) 3 hours ago, BravoTaco said: Very odd. As the random() method just uses the Random class from java. But atleast its working now Okay, I spoke too soon, it started happening again, I removed everything from my script but the following... All I am trying to do is stop my account from logging out. Ugh, have written tons of scripts that are infinetly more complex, why does this one have so many issues .. seems to take longer before it runs into issues though. Before I noticed it after a few minutes, now it runs for about 30 minutes before I start noticing the lag, maybe a hour until crash happens. @Override public int onLoop() { if(players.myPlayer().isAnimating()){ getKeyboard().pressKey(8); getKeyboard().releaseKey(8); } return ThreadLocalRandom.current().nextInt(60000, 240000); } Edited April 23, 2020 by Brian Quote Link to comment Share on other sites More sharing options...
dreameo Posted April 24, 2020 Share Posted April 24, 2020 Quote public void pressKey(int keyCode) Sends a KEY_PRESSED event to the key event handler. Note: only for keys that have no 'character'. Do NOT use for Esc key (and probably a couple of other keys). Parameters: keyCode - The KeyCode for the key to type. This could be your problem. Try getKeyboard().pressKey(VK_Z) // z constant Quote Link to comment Share on other sites More sharing options...
Brian Posted April 24, 2020 Author Share Posted April 24, 2020 1 hour ago, dreameo said: This could be your problem. Try getKeyboard().pressKey(VK_Z) // z constant Hmm okay, I see how that could be a program. It does send a backspace, though looks like it may not be recommended. If I send a Z key or something it will fill up my chat and eventually stop entering so It will eventually stop keeping me logged in, so will need to find another method to stay logged in if the backspace is the issue. Quote Link to comment Share on other sites More sharing options...
Brian Posted April 24, 2020 Author Share Posted April 24, 2020 1 hour ago, dreameo said: This could be your problem. Try getKeyboard().pressKey(VK_Z) // z constant Tried switching to Z temporarily, started lagging after a few minutes. Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted April 24, 2020 Share Posted April 24, 2020 (edited) Try changing from typing a key to just moving the camera randomly. Edited April 24, 2020 by BravoTaco Quote Link to comment Share on other sites More sharing options...
Brian Posted April 25, 2020 Author Share Posted April 25, 2020 14 hours ago, BravoTaco said: Try changing from typing a key to just moving the camera randomly. The issue was mirror mode. Injection works fine, ugh so looks like no fix on my end is possible. Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted April 25, 2020 Share Posted April 25, 2020 15 hours ago, Brian said: The issue was mirror mode. Injection works fine, ugh so looks like no fix on my end is possible. You could also try getKeyboard().typeString("Z", false) Quote Link to comment Share on other sites More sharing options...