From 5aca78492c7cf877caa6c9c39798e5ac861b3b2c Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 4 Nov 2025 15:12:55 -0500 Subject: [PATCH] initial commit --- .gitignore | 33 +++++++++++++++++++++++++++ gta-anti-afk.ahk | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 gta-anti-afk.ahk diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e7c9243 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ + +#Ignore thumbnails created by Windows +Thumbs.db +#Ignore files built by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +.vs/ +.idea/ +#Nuget packages folder +packages/ diff --git a/gta-anti-afk.ahk b/gta-anti-afk.ahk new file mode 100644 index 0000000..9e8d79c --- /dev/null +++ b/gta-anti-afk.ahk @@ -0,0 +1,58 @@ +; GTA Online Anti-AFK Script +; Press F8 to start/stop the script +; The script will press 'W' and 'S' keys every 4 minutes to prevent inactivity kick + +#Requires AutoHotkey v2.0 +#SingleInstance Force + +; Variables +isRunning := false +timerInterval := 240000 ; 4 minutes in milliseconds + +; F8 to toggle the script on/off +F8:: { + global isRunning + isRunning := !isRunning + if (isRunning) { + ToolTip("GTA Anti-AFK: ACTIVE - Sending input every 4 minutes") + SoundBeep(1000, 200) + TrayTip("Script is now ACTIVE", "GTA Anti-AFK") + SetTimer(AntiAFK, timerInterval) + SetTimer(() => ToolTip(), -3000) ; Hide tooltip after 3 seconds + } else { + ToolTip("GTA Anti-AFK: INACTIVE") + SoundBeep(500, 200) + TrayTip("Script is now INACTIVE", "GTA Anti-AFK") + SetTimer(AntiAFK, 0) + SetTimer(() => ToolTip(), -3000) ; Hide tooltip after 3 seconds + } +} + +; Anti-AFK function +AntiAFK() { + ; Send W key (move forward slightly) + Send("{w down}") + Sleep(100) + Send("{w up}") + + Sleep(200) + + ; Send S key (move backward slightly) + Send("{s down}") + Sleep(100) + Send("{s up}") + + ; Optional: Show notification + currentTime := FormatTime(, "HH:mm:ss") + TrayTip("Input sent at " . currentTime, "GTA Anti-AFK") +} + +; F9 to exit the script completely +F9:: { + TrayTip("Script terminated", "GTA Anti-AFK") + Sleep(1000) + ExitApp() +} + +; Show initial instructions +TrayTip("Press F8 to toggle ON/OFF`nPress F9 to exit script", "GTA Anti-AFK")