A lightweight utility designed to prevent AFK (Away From Keyboard) timeouts in games by simulating user activity through random mouse movements and keyboard inputs.
- 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
- Java 21 or later
- Windows operating system (for window detection features)
- Java Development Kit (JDK) 21+
- Gradle (included as wrapper)
-
Clone the repository:
git clone https://github.com/yourusername/anti-afk.git cd anti-afk -
Build with Gradle:
./gradlew build -
Run the application:
./gradlew run
To create a standalone Windows executable:
-
Run the executable creation script:
./create_exe.batNote: This requires WiX Toolset to be installed. See
README_WIX_INSTALLATION.txtfor details. -
The executable installer will be created in the
build/jpackagedirectory.
src/main/java/core/- Core application codeafk/- Anti-AFK engine and movement pattern generationconfig/- Configuration management and game profilesui/- User interface componentsdiagnostics/- Testing and diagnostic tools
src/main/resources/- Configuration files and resources
Game profiles are defined in src/main/resources/default_profiles.json with the following parameters:
gameName: Name of the gameactionIntervalSeconds: Time between actionsmaxPixelMovement: Maximum pixel distance for mouse movementsrightClickAllowed: Whether right-click actions are enabledscreenWidthandscreenHeight: Screen dimensions for movement boundaries
None
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.