Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    chevychase is offline

    Posts
    101

    Simple anti-afk program help

    Hey guys, I couldn't really find an anti-afk program that used the keyboard so I decided to program a really simple one quickly in Java. The main purpose is to stop my account from logging off

    Code:
    import java.awt.AWTException;
    import java.awt.Robot;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import java.util.Random;
    
    public class AutoKeyboard {
    
    Random r = new Random();
    
    public static int randInt(int min, int max) {
    
        int randomNum = rand.nextInt((max - min) + 1) + min;
        return randomNum;
    }
               
    
        public static void main(String[] args) throws InterruptedException {
      
            int running = 1;
            
            while (running == 1) {
    try { 
    
    int delay = randInt(336415,783410); // 5, 0
    Robot robot = new Robot(); 
    
    Thread.sleep(delay);
    robot.keyPress(KeyEvent.VK_SPACE);
    
    } catch (AWTException e) { 
    e.printStackTrace(); 
    } 
    } 
        }
    }
    This seems to work pretty well so far.

    I have two questions though:

    1) Is this detectable? And how could I make it less detectable?
    2) Would this be likely to work for an extended period of time without stopping? E.g. 3-4 hours

    Thanks in advance.

  2. #2
    Senior Member
    Meth is offline

    Posts
    199
    I think it would be detectable, if you just sat there for hours not going afk due to repeated press of space bar I imagine it would be suspicious. To make it less detectable I'd randomize what it actually presses or better yet find the window and just move the mouse in it.

  3. #3
    Senior Member
    chevychase is offline

    Posts
    101
    Quote Originally Posted by jacobsharkey View Post
    I think it would be detectable, if you just sat there for hours not going afk due to repeated press of space bar I imagine it would be suspicious. To make it less detectable I'd randomize what it actually presses or better yet find the window and just move the mouse in it.
    I think I'll stay away from mouse movement because it's been easily detected in the past and I'm not good enough to develop a human mouse movement algorithm anyway. I never thought about randomising the keys so I think that's what I'll try next. Thank you.

  4. #4
    Senior Member
    Meth is offline

    Posts
    199
    All you need to do is calculate the distance between point A to point B and make the mouse move in steps so it moves every single pixel along the way. It's only easily detected when the mouse jumps without any movement, but random key strokes should suffice. Just do a random int and use a switch

  5. #5
    Casualty of War
    Incognito is offline

    Posts
    447
    Sticky's Sidekick does this, just don't use the restationer
    Skype: BS.Incognito

  6. #6
    #Return
    Scarecrow is offline

    Posts
    3,443
    I actually believe (for some weird reason) DiS anti afks you for some bizarre reason. I use it if I ever need to ask for a long period of time.

  7. #7
    Senior Member
    WatchMeWin is offline

    Posts
    854
    Quote Originally Posted by Scarecrow View Post
    I actually believe (for some weird reason) DiS anti afks you for some bizarre reason. I use it if I ever need to ask for a long period of time.
    inb4 hidden button smashing.
    new life, who this

  8. #8
    Senior Member
    Meth is offline

    Posts
    199
    Quote Originally Posted by Scarecrow View Post
    I actually believe (for some weird reason) DiS anti afks you for some bizarre reason. I use it if I ever need to ask for a long period of time.
    It does. Which is actually kind of scary. I hope it doesn't just constantly keep pressing something..

  9. #9
    Senior Member
    chevychase is offline

    Posts
    101
    So I finished it with jacobsharkey's suggestion. It just sends random keystrokes every 5-15 minutes now, ran it for a day and it kept my client awake. Yay.

  10. #10
    Member
    hscker0101 is offline

    Posts
    84
    I was on a smh doing perm and it keep you long on so when your done turn DIS off

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •