diff --git a/QuickMacro.ahk b/QuickMacro.ahk index 206990f..9285ded 100644 --- a/QuickMacro.ahk +++ b/QuickMacro.ahk @@ -1,7 +1,20 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; +; RUN AS ADMIN +Loop, %0% + { + param := %A_Index% + params .= A_Space . param + } +ShellExecute := A_IsUnicode ? "shell32\ShellExecute":"shell32\ShellExecuteA" + +IF NOT A_IsAdmin +{ + If A_IsCompiled + DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1) + Else + DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1) + ExitApp +} +; END RUN AS ADMIN #NoEnv #InstallKeybdHook @@ -11,7 +24,7 @@ #Include %A_ScriptDir%\includes\keys.ahk #Include %A_ScriptDir%\includes\conf.ahk #Include %A_ScriptDir%\includes\tray.ahk -#Include %A_ScriptDir%\includes\crosshair.ahk +#include %A_ScriptDir%\includes\process_suspend.ahk loadConf() @@ -20,4 +33,4 @@ End:: return #Include %A_ScriptDir%\includes\labels.ahk -#Include %A_ScriptDir%\includes\functions.ahk \ No newline at end of file +#Include %A_ScriptDir%\includes\functions.ahk diff --git a/QuickMacro.exe b/QuickMacro.exe new file mode 100644 index 0000000..4d32abd Binary files /dev/null and b/QuickMacro.exe differ diff --git a/QuickMacro.ini b/QuickMacro.ini new file mode 100644 index 0000000..94a0565 Binary files /dev/null and b/QuickMacro.ini differ diff --git a/README.md b/README.md index 33f480f..beda47e 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,36 @@ # QuickMacro -GTA Online useful macros +GTA Online useful macros +This is a fork from https://github.com/MacMailler/QuickMacro that I reworked to do what I want it to do. Big Thanks to MacMailler for creating QuickMacro. + +Features like sound when enabling QuickMacro/CEO Mode or Empty session are coming from Kezoura (https://github.com/kezoura/GTAO-Macro) ### Installation and using -1. [Download](https://github.com/MacMailler/QuickMacro/releases) latest version -2. Unpack to any place -3. Run GTA Online -4. Run QuickMacro.exe (after opening GTAV window) -5. Press the "End" key +1. [Download](https://github.com/Liscum/QuickMacro/raw/master/QuickMacro.exe) latest version +2. Run GTA Online +3. Run QuickMacro.exe (after opening GTAV window) +4. Press the "End" key ### Hotkeys + End - Enable/Disable -+ Num0 + Num1 - Call Pegasus -+ Num0 + Num2 - Call Mechanic -+ Num0 + Num3 - Call Lester -+ Num0 + Num4 - Spawn Buzzard -+ Num0 + Num5 - Activate ghost team -+ Num0 + Num6 - Call Mors Mutual Insurance -+ Num0 + Num7 - Get heavy armor -+ Num0 + Num8 - Repeat button -+ Num0 + Num9 - Show/Hide crosshair -+ NumAdd - Spawn BST(Bull Shark Testosterone) -+ NumDiv - Toggle CEO Mode -+ NumSub - Buy ammo -+ LAlt - Fast heavy weapon reload -+ NumEnter - Fast EWO -+ NumDot - Get snack -+ RCtrl & RShift - Outfit fix ++ NumDot : Snacks ++ NumpadDiv : CEO Mode ++ NumpadMult : Show usage ++ Num0 + Num1 : Call Mechanic ++ Num0 + Num2 : Call Lester ++ Num0 + Num3 : Call MorsMutualAssurance ++ Num0 + Num4 : Call Assistant ++ Num0 + Num5 : Armor ++ Num0 + Num6 : Bribe Authority ++ Num0 + Num7 : Ghost organisation ++ Num0 + Num8 : Personal vehicle ++ Num0 + Num9 : Mk2 ++ Num0 + NumAdd : Lower Wanted Level ++ RCtrl + RShift : Empty session + + +While in game, hitting NumpadMult will show the association between keys and actions : + + +

+ +

diff --git a/Usage.png b/Usage.png new file mode 100644 index 0000000..801418b Binary files /dev/null and b/Usage.png differ diff --git a/assets/crosshair.png b/assets/crosshair.png deleted file mode 100644 index 8aa2d56..0000000 Binary files a/assets/crosshair.png and /dev/null differ diff --git a/assets/vip-disabled.mp3 b/assets/vip-disabled.mp3 new file mode 100644 index 0000000..d4ce982 Binary files /dev/null and b/assets/vip-disabled.mp3 differ diff --git a/assets/vip-enabled.mp3 b/assets/vip-enabled.mp3 new file mode 100644 index 0000000..9cd56f3 Binary files /dev/null and b/assets/vip-enabled.mp3 differ diff --git a/includes/conf.ahk b/includes/conf.ahk index 8bde829..a6a0d79 100644 --- a/includes/conf.ahk +++ b/includes/conf.ahk @@ -1,67 +1,56 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - Global SettingsFile := "QuickMacro.ini" loadConf() { IfExist, %SettingsFile% { - IniRead, keyPhoneDalay, %SettingsFile%, Delays, KeyPhoneDalay + IniRead, keyPhoneDelay, %SettingsFile%, Delays, KeyPhoneDelay IniRead, keyPhoneDuration, %SettingsFile%, Delays, KeyPhoneDuration IniRead, phoneDelay, %SettingsFile%, Delays, PhoneDelay IniRead, menuDelay, %SettingsFile%, Delays, MenuDelay IniRead, keyMDelay, %SettingsFile%, Delays, KeyMDelay IniRead, keyMDuration, %SettingsFile%, Delays, KeyMDuration - IniRead, RepeatButtonDelay, %SettingsFile%, Delays, RepeatButtonDelay - IniRead, heavyWeaponKey, %SettingsFile%, Keys, HeavyWeaponKey - IniRead, specialWeaponKey, %SettingsFile%, Keys, SpecialWeaponKey - IniRead, RepeatButton, %SettingsFile%, Keys, RepeatButton - IniRead, PegasusKey, %SettingsFile%, Hotkeys, PegasusKey + IniRead, MechanicKey, %SettingsFile%, Hotkeys, MechanicKey IniRead, LesterKey, %SettingsFile%, Hotkeys, LesterKey - IniRead, BuzzardKey, %SettingsFile%, Hotkeys, BuzzardKey - IniRead, GhostKey, %SettingsFile%, Hotkeys, GhostKey + IniRead, MorsMutualKey, %SettingsFile%, Hotkeys, MorsMutualKey + IniRead, AssistantKey, %SettingsFile%, Hotkeys, AssistantKey IniRead, ArmorKey, %SettingsFile%, Hotkeys, ArmorKey + IniRead, BribeKey, %SettingsFile%, Hotkeys, BribeKey + IniRead, GhostKey, %SettingsFile%, Hotkeys, GhostKey + IniRead, VehicleKey, %SettingsFile%, Hotkeys, VehicleKey + IniRead, Mk2Key, %SettingsFile%, Hotkeys, Mk2Key IniRead, SnackKey, %SettingsFile%, Hotkeys, SnackKey - IniRead, BullsharkKey, %SettingsFile%, Hotkeys, BullsharkKey - IniRead, AmmoKey, %SettingsFile%, Hotkeys, AmmoKey IniRead, ToggleCeoKey, %SettingsFile%, Hotkeys, ToggleCeoKey - IniRead, MorsMutualKey, %SettingsFile%, Hotkeys, MorsMutualKey - IniRead, FastHeavyReloadKey, %SettingsFile%, Hotkeys, FastHeavyReloadKey - IniRead, FastEwoKey, %SettingsFile%, Hotkeys, FastEwoKey - IniRead, RepeatButtonKey, %SettingsFile%, Hotkeys, RepeatButtonKey - IniRead, CrosshairKey, %SettingsFile%, Hotkeys, CrosshairKey - IniRead, OutfitFixKey, %SettingsFile%, Hotkeys, OutfitFixKey + IniRead, LowerWantedLevelKey, %SettingsFile%, Hotkeys, LowerWantedLevelKey + IniRead, EmptySessionKey, %SettingsFile%, Hotkeys, EmptySessionKey + + IniRead, UsageKey, %SettingsFile%, Hotkeys, UsageKey + } else { - IniWrite, %keyPhoneDalay%, %SettingsFile%, Delays, KeyPhoneDalay + IniWrite, %keyPhoneDelay%, %SettingsFile%, Delays, KeyPhoneDelay IniWrite, %keyPhoneDuration%, %SettingsFile%, Delays, KeyPhoneDuration IniWrite, %phoneDelay%, %SettingsFile%, Delays, PhoneDelay IniWrite, %menuDelay%, %SettingsFile%, Delays, MenuDelay IniWrite, %keyMDelay%, %SettingsFile%, Delays, KeyMDelay IniWrite, %keyMDuration%, %SettingsFile%, Delays, KeyMDuration - IniWrite, %RepeatButtonDelay%, %SettingsFile%, Delays, RepeatButtonDelay - IniWrite, %heavyWeaponKey%, %SettingsFile%, Keys, HeavyWeaponKey - IniWrite, %specialWeaponKey%, %SettingsFile%, Keys, SpecialWeaponKey - IniWrite, %RepeatButton%, %SettingsFile%, Keys, RepeatButton - IniWrite, %PegasusKey%, %SettingsFile%, Hotkeys, PegasusKey + IniWrite, %MechanicKey%, %SettingsFile%, Hotkeys, MechanicKey IniWrite, %LesterKey%, %SettingsFile%, Hotkeys, LesterKey - IniWrite, %BuzzardKey%, %SettingsFile%, Hotkeys, BuzzardKey - IniWrite, %GhostKey%, %SettingsFile%, Hotkeys, GhostKey + IniWrite, %MorsMutualKey%, %SettingsFile%, Hotkeys, MorsMutualKey + IniWrite, %AssistantKey%, %SettingsFile%, Hotkeys, AssistantKey IniWrite, %ArmorKey%, %SettingsFile%, Hotkeys, ArmorKey + IniWrite, %BribeKey%, %SettingsFile%, Hotkeys, BribeKey + IniWrite, %GhostKey%, %SettingsFile%, Hotkeys, GhostKey + IniWrite, %VehicleKey%, %SettingsFile%, Hotkeys, VehicleKey + IniWrite, %Mk2Key%, %SettingsFile%, Hotkeys, Mk2Key IniWrite, %SnackKey%, %SettingsFile%, Hotkeys, SnackKey - IniWrite, %BullsharkKey%, %SettingsFile%, Hotkeys, BullsharkKey - IniWrite, %AmmoKey%, %SettingsFile%, Hotkeys, AmmoKey IniWrite, %ToggleCeoKey%, %SettingsFile%, Hotkeys, ToggleCeoKey - IniWrite, %MorsMutualKey%, %SettingsFile%, Hotkeys, MorsMutualKey - IniWrite, %FastHeavyReloadKey%, %SettingsFile%, Hotkeys, FastHeavyReloadKey - IniWrite, %FastEwoKey%, %SettingsFile%, Hotkeys, FastEwoKey - IniWrite, %RepeatButtonKey%, %SettingsFile%, Hotkeys, RepeatButtonKey - IniWrite, %CrosshairKey%, %SettingsFile%, Hotkeys, CrosshairKey - IniWrite, %OutfitFixKey%, %SettingsFile%, Hotkeys, OutfitFixKey + IniWrite, %LowerWantedLevelKey%, %SettingsFile%, Hotkeys, LowerWantedLevelKey + IniWrite, %EmptySessionKey%, %SettingsFile%, Hotkeys, EmptySessionKey + + IniWrite, %UsageKey%, %SettingsFile%, Hotkeys, UsageKey + } -} \ No newline at end of file +} diff --git a/includes/crosshair.ahk b/includes/crosshair.ahk deleted file mode 100644 index 90d3cba..0000000 --- a/includes/crosshair.ahk +++ /dev/null @@ -1,28 +0,0 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - -Global crossHairT := false -Global crossHairW := 21 -Global crossHairH := 21 - -Global backgroundColor := 0xff00cc - -SysGet, screenW, 78 -SysGet, screenH, 79 - -Global crossHairX := (screenW / 2) - (crossHairH / 2) -Global crossHairY := (screenH / 2) - (crossHairH / 2) - -IfNotExist, %A_WorkingDir%\assets - FileCreateDir, %A_WorkingDir%\assets - -FileInstall, assets\crosshair.png, %A_WorkingDir%\assets\crosshair.png, false - -Gui, QuickMacroCrosshair: New, +AlwaysOnTop -Border -Caption -Gui, Color, backgroundColor -Gui, Add, Picture, x0 y0 w%crossHairW% h%crossHairH%, %A_WorkingDir%\assets\crosshair.png -Gui, Show, w%crossHairW% h%crossHairH% x%crossHairX% y%crossHairY%, QuickMacroCrosshair -WinSet, TransColor, backgroundColor, QuickMacroCrosshair -Gui, QuickMacroCrosshair: Hide \ No newline at end of file diff --git a/includes/functions.ahk b/includes/functions.ahk index 7f6a6c6..fc41e3b 100644 --- a/includes/functions.ahk +++ b/includes/functions.ahk @@ -1,47 +1,51 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - init() { - if (WinExist("Grand Theft Auto V")) { - hotkeyState := hotkeyState = "On" ? "Off" : "On" - Menu, Tray, Tip, QuickMacro`n%hotkeyState% + ceo_status = Disabled + if (WinExist(GameTitle)) { + hotkeyState := hotkeyState = "ON" ? "OFF" : "ON" + if (playerState = 0) { + Menu, Tray, Tip,GTAO Macro: %hotkeyState%`nVIP Mode: Disabled + } else { + Menu, Tray, Tip,GTAO Macro: %hotkeyState%`nVIP Mode: Enabled + } setHotkeyState(hotkeyState) - if (hotkeyState = "On") + if (hotkeyState = "ON") { Menu, Tray, Rename, Activate, Deactivate - else + SoundBeep, 800 + } else{ Menu, Tray, Rename, Deactivate, Activate + SoundBeep, 450 + } } else { - msgbox, 0x40, QuickMacro, GTAV is not running! + msgbox, 16, Error, GTA V is not running! } } setHotkeyState(t) { Hotkey, IfWinActive, Grand Theft Auto V - Hotkey, %PegasusKey%, pegasusLabel, %t% + Hotkey, %MechanicKey%, mechanicLabel, %t% Hotkey, %LesterKey%, lesterLabel, %t% - Hotkey, %BuzzardKey%, buzzardLabel, %t% - Hotkey, %GhostKey%, ghostLabel, %t% + Hotkey, %MorsMutualKey%, morsMutualLabel, %t% + Hotkey, %AssistantKey%, AssistantLabel, %t% Hotkey, %ArmorKey%, armorLabel, %t% + Hotkey, %BribeKey%, bribeLabel, %t% + Hotkey, %GhostKey%, ghostLabel, %t% + Hotkey, %VehicleKey%, vehicleLabel, %t% + Hotkey, %Mk2Key%, mk2Label, %t% Hotkey, %SnackKey%, snackLabel, %t% - Hotkey, %BullsharkKey%, bullsharkLabel, %t% - Hotkey, %AmmoKey%, ammoLabel, %t% Hotkey, %ToggleCeoKey%, toggleCeoLabel, %t% - Hotkey, %MorsMutualKey%, morsMutualLabel, %t% - Hotkey, %FastHeavyReloadKey%, fastHeavyReloadLabel, %t% - Hotkey, %FastEwoKey%, fastEwoLabel, %t% - Hotkey, %RepeatButtonKey%, repeatButtonLabel, %t% - Hotkey, %CrosshairKey%, crossHairLabel, %t% - Hotkey, %OutfitFixKey%, outfitFixLabel, %t% + Hotkey, %LowerWantedLevelKey%, lowerWantedLevelLabel, %t% + Hotkey, %EmptySessionKey%, emptySessionLabel, %t% + + Hotkey, %UsageKey%, usageLabel, %t% + T := false } phoneUp() { - setkeydelay, %keyPhoneDalay%, %keyPhoneDuration% + setkeydelay, %keyPhoneDelay%, %keyPhoneDuration% Send {Up} sleep, %phoneDelay% } @@ -53,41 +57,44 @@ openM() { } toggleCeo() { - if(playerState = 0) + if (playerState = 0) { playerState := 1 - else + ceo_status = Enabled + Menu, Tray, Tip,GTAO Macro: %hotkeyState%`nVIP Mode: %ceo_status% + SoundPlay, %A_ScriptDir%\assets\vip-enabled.mp3, Wait + } else { playerState := 0 + ceo_status = Disabled + Menu, Tray, Tip,GTAO Macro: %hotkeyState%`nVIP Mode: %ceo_status% + SoundPlay, %A_ScriptDir%\assets\vip-disabled.mp3, Wait + } } callService(s) { phoneUp() Send {Right}{Up}{Enter} - - if(s = "Pegasus") - Send {Up 3}{Enter} + + if(s = "Mechanic") + Send {Left 2}{Up}{Enter} + + else if(s = "Lester") + Send {Left 3}{Enter} else if(s = "MorsMutual") - Send {Up 4}{Enter} - - else if(s = "Mechanic") - Send {Up 6}{Enter} + Send {Left 2}{Down}{Enter} - else if(s = "Lester") - Send {Up 10}{Enter} + else if(s = "Assistant") + Send {Left 5}{Enter} } ceoAbil(a) { if(playerState = 1) { openM() Send {Enter} - if(a = "Buzzard") - Send {Up 2}{Enter}{Down 4}{Enter} - - else if(a = "Bullshark") - Send {Up 3}{Enter}{Down 1}{Enter} - - else if(a = "Gost") + if(a = "Gost") Send {Up 3}{Enter}{Up 3}{Enter} + else if (a = "Bribe") + Send {Up 3}{Enter}{Up 2}{Enter} } } @@ -95,69 +102,69 @@ getItem(i) { openM() if(i = "Armor") { if(playerState = 0) - Send {Down} - else Send {Down 2} + else + Send {Down 3} Send {Enter}{Down}{Enter}{Up 3}{Enter} } else if(i = "Snack") { if(playerState = 0) - Send {Down} - else Send {Down 2} + else + Send {Down 3} Send {Enter}{Down 2}{Enter 3} } - else if(i = "Ammo") { + else if(i = "Vehicle") { if(playerState = 0) - Send {Down} + Send {Down 4} else - Send {Down 2} - Send {Enter}{Down 3}{Enter}{Up}{Enter} + Send {Down 5} + Send {Enter}{Enter} + } + else if(i = "Mk2") { + if(playerState = 0) + Send {Down 5}{Enter}{Up}{Enter}{Down 2}{Enter} + else + Send {Down 6}{Enter}{Up}{Enter}{Down 2}{Enter} + Send {Enter}{Enter} } Send {SC032} } -fastHeavyReload() { - setkeydelay, %keyMDelay%, %keyMDuration% - Send {%specialWeaponKey%} - Send {%heavyWeaponKey%} -} - -fastEwo() { +lowerWantedLevel(){ openM() - Send {Up 2} - Send {SC02E down} - Send {Enter} - Send {SC02E up} + if(playerState = 0) + Send {Down 3}{Enter}{Down}{Enter}{Down}{Right}{ESC 3} + else + Send {Down 4}{Enter}{Down}{Enter}{Down}{Right}{ESC 3} } -toggleCrosshair() { - if(crossHairT = false) { - Gui, QuickMacroCrosshair: Show - WinActivate, ahk_class grcWindow - } else { - Gui, QuickMacroCrosshair: Hide - } - crossHairT := !crossHairT +emptySession() { + Process_Suspend("GTA5.exe") + Sleep, 10000 + Process_Resume("GTA5.exe") + MsgBox, 64, %Title% %version%, Session cleared!, 1 } -outfitFix() { - openM() - - if(playerState = 0) - Send {Down 2} - else - Send {Down 3} - - Send {Enter}{Down 3}{Enter} - Send {SC032} +usage(u) { + if(u = "Usage") +textUsage = +( +Usage : + NumDot : Snacks + NumpadDiv : CEO Mode + NumpadMult : Show usage + Num0 + Num1 : Call Mechanic + Num0 + Num2 : Call Lester + Num0 + Num3 : Call MorsMutualAssurance + Num0 + Num4 : Call Assistant + Num0 + Num5 : Armor + Num0 + Num6 : Bribe Authority + Num0 + Num7 : Ghost organisation + Num0 + Num8 : Personal vehicle + Num0 + Num9 : Mk2 + Num0 + NumAdd : Lower wanted level + RCtrl + RShift : Empty session +) + msgbox, 0x40, QuickMacro, %textUsage% } - -repeatButton() { - if(T = true) { - setTimer, loopRepeatButton, off - } else { - setTimer, loopRepeatButton, on - } - T := !T -} \ No newline at end of file diff --git a/includes/keys.ahk b/includes/keys.ahk index 8be230e..2a2a157 100644 --- a/includes/keys.ahk +++ b/includes/keys.ahk @@ -1,21 +1,14 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - -Global PegasusKey := "Numpad0 & Numpad1" -Global MechanicKey := "Numpad0 & Numpad2" -Global LesterKey := "Numpad0 & Numpad3" -Global BuzzardKey := "Numpad0 & Numpad4" -Global GhostKey := "Numpad0 & Numpad5" -Global MorsMutualKey := "Numpad0 & Numpad6" -Global ArmorKey := "Numpad0 & Numpad7" +Global MechanicKey := "Numpad0 & Numpad1" +Global LesterKey := "Numpad0 & Numpad2" +Global MorsMutualKey := "Numpad0 & Numpad3" +Global AssistantKey := "Numpad0 & Numpad4" +Global ArmorKey := "Numpad0 & Numpad5" +Global Bribekey := "Numpad0 & Numpad6" +Global GhostKey := "Numpad0 & Numpad7" +Global VehicleKey := "Numpad0 & Numpad8" +Global Mk2Key := "Numpad0 & Numpad9" +Global LowerWantedLevelKey := "Numpad0 & NumpadAdd" Global SnackKey := "NumpadDot" -Global BullsharkKey := "NumpadAdd" -Global AmmoKey := "NumpadSub" Global ToggleCeoKey := "NumpadDiv" -Global FastHeavyReloadKey := "LAlt" -Global FastEwoKey := "NumpadEnter" -Global RepeatButtonKey := "Numpad0 & Numpad8" -Global CrosshairKey := "Numpad0 & Numpad9" -Global OutfitFixKey := "RCtrl & RShift" \ No newline at end of file +Global emptySessionKey := "RCtrl & RShift" +Global UsageKey := "NumpadMult" \ No newline at end of file diff --git a/includes/labels.ahk b/includes/labels.ahk index 49fd0d3..3e2001d 100644 --- a/includes/labels.ahk +++ b/includes/labels.ahk @@ -1,14 +1,4 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - - ; Services -pegasusLabel: - callService("Pegasus") -return - mechanicLabel: callService("Mechanic") return @@ -21,22 +11,22 @@ morsMutualLabel: callService("MorsMutual") return +AssistantLabel: + callService("Assistant") +return + ; CEO abilities toggleCeoLabel: toggleCeo() return -buzzardLabel: - ceoAbil("Buzzard") -return - ghostLabel: ceoAbil("Gost") return -bullsharkLabel: - ceoAbil("Bullshark") +bribeLabel: + ceoAbil("Bribe") return @@ -49,43 +39,30 @@ snackLabel: getItem("Snack") return -ammoLabel: - getItem("Ammo") -return - - -; Others -fastHeavyReloadLabel: - fastHeavyReload() +vehicleLabel: + getItem("Vehicle") return -fastEwoLabel: - fastEwo() +mk2Label: + getItem("Mk2") return -repeatButtonLabel: - repeatButton() -return - -crossHairLabel: - toggleCrosshair() +activateLabel: + init() return -outfitFixLabel: - outfitFix() +exitLabel: + ExitApp return -loopRepeatButton: - while(T) { - Send {%RepeatButton%} - sleep, RepeatButtonDelay - } +usageLabel: + usage("Usage") return -activateLabel: - init() +lowerWantedLevelLabel: + lowerWantedLevel() return -exitLabel: - ExitApp +emptySessionLabel: + emptySession() return \ No newline at end of file diff --git a/includes/process_suspend.ahk b/includes/process_suspend.ahk new file mode 100644 index 0000000..3576d40 --- /dev/null +++ b/includes/process_suspend.ahk @@ -0,0 +1,24 @@ +Process_Suspend(PID_or_Name) { + PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name + h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid) + if !h + return -1 + + DllCall("ntdll.dll\NtSuspendProcess", "Int", h) + DllCall("CloseHandle", "Int", h) +} + +Process_Resume(PID_or_Name) { + PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name + h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid) + if !h + return -1 + + DllCall("ntdll.dll\NtResumeProcess", "Int", h) + DllCall("CloseHandle", "Int", h) +} + +ProcExist(PID_or_Name="") { + Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name + return Errorlevel +} \ No newline at end of file diff --git a/includes/tray.ahk b/includes/tray.ahk index 90932c3..e4133b7 100644 --- a/includes/tray.ahk +++ b/includes/tray.ahk @@ -1,10 +1,6 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; - Menu, Tray, Tip, QuickMacro`nOff Menu, Tray, NoStandard Menu, Tray, Add, Activate, activateLabel -Menu, Tray, Add, Close, exitLabel \ No newline at end of file +Menu, Tray, Add, Empty Session, emptySessionLabel +Menu, Tray, Add, Close, exitLabel diff --git a/includes/variables.ahk b/includes/variables.ahk index 4ccc842..bba5d2f 100644 --- a/includes/variables.ahk +++ b/includes/variables.ahk @@ -1,12 +1,10 @@ -; -; Copyright (C) 2017 MacMailler -; GitHub: https://github.com/MacMailler/QuickMacro -; +Global Title := "GTA Macro" +Global GameTitle := "Grand Theft Auto V" -Global hotkeyState := "Off" +Global hotkeyState := "OFF" Global playerState := 0 -Global keyPhoneDalay := 70 +Global keyPhoneDelay := 70 Global keyPhoneDuration := 100 Global phoneDelay := 550 @@ -14,10 +12,4 @@ Global menuDelay := 24 Global keyMDelay := 36 Global keyMDuration := 36 -Global RepeatButtonDelay := 1000 -Global RepeatButton := "Enter" - -Global heavyWeaponKey := 4 -Global specialWeaponKey := 5 - -Global T := false \ No newline at end of file +Global T := false