Skip to content

A lightweight utility designed to prevent AFK (Away From Keyboard) timeouts in games by simulating user activity through random mouse movements and keyboard inputs.

Notifications You must be signed in to change notification settings

nikunj-kohli/Anti-AFK

Repository files navigation

Anti-AFK Tool

A lightweight utility designed to prevent AFK (Away From Keyboard) timeouts in games by simulating user activity through random mouse movements and keyboard inputs.

Features

  • Game-Specific Profiles: Customize settings for different games
  • Configurable Actions: Adjust movement patterns, intervals, and input types
  • Window Detection: Only activates when the specified game window is in focus
  • System Tray Integration: Runs discreetly in the system tray
  • User-Friendly Interface: Simple controls for starting/stopping and configuration

Requirements

  • Java 21 or later
  • Windows operating system (for window detection features)

Development Setup

Prerequisites

  • Java Development Kit (JDK) 21+
  • Gradle (included as wrapper)

Building from Source

  1. Clone the repository:

    git clone https://github.com/yourusername/anti-afk.git
    cd anti-afk
    
  2. Build with Gradle:

    ./gradlew build
    
  3. Run the application:

    ./gradlew run
    

Creating Executable

To create a standalone Windows executable:

  1. Run the executable creation script:

    ./create_exe.bat
    

    Note: This requires WiX Toolset to be installed. See README_WIX_INSTALLATION.txt for details.

  2. The executable installer will be created in the build/jpackage directory.

Project Structure

  • src/main/java/core/ - Core application code
    • afk/ - Anti-AFK engine and movement pattern generation
    • config/ - Configuration management and game profiles
    • ui/ - User interface components
    • diagnostics/ - Testing and diagnostic tools
  • src/main/resources/ - Configuration files and resources

Configuration

Game profiles are defined in src/main/resources/default_profiles.json with the following parameters:

  • gameName: Name of the game
  • actionIntervalSeconds: Time between actions
  • maxPixelMovement: Maximum pixel distance for mouse movements
  • rightClickAllowed: Whether right-click actions are enabled
  • screenWidth and screenHeight: Screen dimensions for movement boundaries

License

None

Disclaimer

This tool is intended for legitimate use cases such as preventing timeouts during brief periods of inactivity. Use responsibly and in accordance with the terms of service of any games or applications.

About

A lightweight utility designed to prevent AFK (Away From Keyboard) timeouts in games by simulating user activity through random mouse movements and keyboard inputs.

Resources

Stars

Watchers

Forks

Packages

No packages published