Skip to content

Commit 5dbce5c

Browse files
authored
Merge pull request #3 from Ven0m0/claude/optimize-refactor-dedupe-011CUxyCN2XzG7xfJAfTpG8R
2 parents ea7280b + 41a44ea commit 5dbce5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+785
-797
lines changed

AHK/Black ops 6/AFK Balcony.ahk

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
; UIA check
2-
if !InStr(A_AhkPath, "_UIA.exe") {
3-
Run, % A_AhkPath . " U" (32 << A_Is64bitOS) "_UIA.exe"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript()
63

74
#SingleInstance, Force
85
#NoEnv
96
#Warn
10-
#KeyHistory 0
11-
ListLines Off
12-
SetBatchLines, 10ms
13-
SendMode Input
7+
#MaxHotkeysPerInterval 99000000
8+
#HotkeyInterval 99000000
9+
SetBatchLines, -1
10+
Process, Priority, , A
1411

1512
F6::
1613
SetTimer , AFK , 500

AHK/Black ops 6/AFK Bank Roof - Always.ahk

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
; UIA check
2-
if !InStr(A_AhkPath, "_UIA.exe") {
3-
Run, % A_AhkPath . " U" (32 << A_Is64bitOS) "_UIA.exe"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript()
63

74
#SingleInstance, Force
85
#NoEnv
96
#Warn
10-
#KeyHistory 0
117
#MaxHotkeysPerInterval 99000000
128
#HotkeyInterval 99000000
13-
ListLines Off
14-
SetBatchLines, -1 ; Script doesnt sleep every line (CPU heavy)
15-
SendMode Input
9+
SetBatchLines, -1
1610
Process, Priority, , A
17-
;Incase SendMode Input doesn't work
18-
SetKeyDelay, -1, -1
19-
SetMouseDelay, -1
20-
SetDefaultMouseSpeed, 0
21-
SetWinDelay, -1
22-
SetControlDelay, -1
2311

2412
F6::
2513
SetTimer , AFK , 100

AHK/Black ops 6/AFK Bank Roof -Loot (experimental).ahk

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
; UIA check
2-
if !InStr(A_AhkPath, "_UIA.exe") {
3-
Run, % A_AhkPath . " U" (32 << A_Is64bitOS) "_UIA.exe"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript()
63

74
#SingleInstance, Force
85
#NoEnv
96
#Warn
10-
#KeyHistory 0
117
#MaxHotkeysPerInterval 99000000
128
#HotkeyInterval 99000000
13-
ListLines Off
14-
SetBatchLines, -1 ;Script doesnt sleep every line (CPU heavy)
15-
; SetBatchLines, 10ms ;Script sleeps 10ms every line
16-
SendMode Input
9+
SetBatchLines, -1
1710
Process, Priority, , A
18-
;Incase SendMode Input doesn't work
19-
SetKeyDelay, -1, -1
20-
SetMouseDelay, -1
21-
SetDefaultMouseSpeed, 0
22-
SetWinDelay, -1
23-
SetControlDelay, -1
2411

2512
; Function to walk forward and back
2613
WalkForwardAndBack()

AHK/Black ops 6/AFK Bank Roof.ahk

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
; UIA check
2-
if !InStr(A_AhkPath, "_UIA.exe") {
3-
Run, % A_AhkPath . " U" (32 << A_Is64bitOS) "_UIA.exe"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript()
63

74
#SingleInstance, Force
85
#NoEnv
96
#Warn
10-
#KeyHistory 0
117
#MaxHotkeysPerInterval 99000000
128
#HotkeyInterval 99000000
13-
ListLines Off
14-
SetBatchLines, -1 ; Script doesnt sleep every line (CPU heavy)
15-
SendMode Input
9+
SetBatchLines, -1
1610
Process, Priority, , A
17-
;Incase SendMode Input doesn't work
18-
SetKeyDelay, -1, -1
19-
SetMouseDelay, -1
20-
SetDefaultMouseSpeed, 0
21-
SetWinDelay, -1
22-
SetControlDelay, -1
2311

2412
; Function to clean up remaining zombies
2513
CleanUpZombies()

AHK/Black ops 6/AFK Hold Click.ahk

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
; UIA check
2-
if !InStr(A_AhkPath, "_UIA.exe") {
3-
Run, % A_AhkPath . " U" (32 << A_Is64bitOS) "_UIA.exe"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript()
63

74
#SingleInstance, Force
85
#NoEnv
96
#Warn
10-
#KeyHistory 0
117
#MaxHotkeysPerInterval 99000000
128
#HotkeyInterval 99000000
13-
ListLines Off
14-
SetBatchLines, -1 ; Script doesnt sleep every line (CPU heavy)
15-
SendMode Input
9+
SetBatchLines, -1
1610
Process, Priority, , A
17-
;Incase SendMode Input doesn't work
18-
SetKeyDelay, -1, -1
19-
SetMouseDelay, -1
20-
SetDefaultMouseSpeed, 0
21-
SetWinDelay, -1
22-
SetControlDelay, -1
2311

2412
F6::
2513
Send {LButton down}

AHK/Fullscreen Double Key.ahk

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
if not A_IsAdmin
2-
{
3-
Run *RunAs "%A_ScriptFullPath%"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\Lib\AHK_Common.ahk
2+
#Include %A_ScriptDir%\..\Lib\WindowManager.ahk
3+
4+
InitScript(true, true) ; UIA + Admin required
5+
66
#NoEnv
77
SetBatchLines -1
88
SetControlDelay -1
9-
ListLines Off
109
#SingleInstance Force
1110
#persistent
1211
#Warn
13-
SetTimer, abcdef, 10
1412

15-
abcdef:
16-
{
13+
; Ctrl+Alt+K for fullscreen
1714
^!k::
18-
WinSet, AlwaysOnTop, On, A ; Focus
19-
WinSet, Style, -0xC00000, A ; hide title bar
20-
WinSet, Style, -0x800000, A ; hide thin-line border
21-
WinSet, Style, -0x400000, A ; hide dialog frame
22-
WinSet, Style, -0x40000, A ; hide thickframe/sizebox
23-
WinMove, A, , 0, 0, A_ScreenWidth, A_ScreenHeight
24-
return
25-
}
2615
{
27-
^!l::
28-
WinSet, AlwaysOnTop, Off, A ; Focus
29-
WinSet, Style, +0xC00000, A ; show title bar
30-
WinSet, Style, +0x800000, A ; show thin-line border
31-
WinSet, Style, +0x400000, A ; show dialog frame
32-
WinSet, Style, +0x40000, A ; show thickframe/sizebox
33-
WinMove, A, , 0, 0, 1280, 720
16+
WinSet, AlwaysOnTop, On, A
17+
SetWindowBorderless("A")
18+
WinMove, A, , 0, 0, A_ScreenWidth, A_ScreenHeight
19+
}
3420
return
21+
22+
; Ctrl+Alt+L to restore window
23+
^!l::
24+
{
25+
WinSet, AlwaysOnTop, Off, A
26+
WinSet, Style, +0xC00000, A ; show title bar
27+
WinSet, Style, +0x800000, A ; show thin-line border
28+
WinSet, Style, +0x400000, A ; show dialog frame
29+
WinSet, Style, +0x40000, A ; show thickframe/sizebox
30+
WinMove, A, , 0, 0, 1280, 720
3531
}
32+
return

AHK/Fullscreen Single Key.ahk

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,44 @@
1-
if not A_IsAdmin
2-
{
3-
Run *RunAs "%A_ScriptFullPath%"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\Lib\AHK_Common.ahk
2+
#Include %A_ScriptDir%\..\Lib\WindowManager.ahk
3+
4+
InitScript(true, true) ; UIA + Admin required
5+
66
#NoEnv
77
SetBatchLines -1
88
SetControlDelay -1
9-
ListLines Off
109
#SingleInstance Force
1110
#persistent
1211
#Warn
1312

13+
; End key with double-tap detection for fullscreen toggle
1414
End::
1515
{
16-
KeyWait, End
17-
KeyWait, End, D T.2
18-
If (!ErrorLevel)
19-
{
20-
goto, double
21-
}
22-
Else
23-
goto, single
16+
KeyWait, End
17+
KeyWait, End, D T.2
18+
If (!ErrorLevel)
19+
{
20+
goto, double
21+
}
22+
Else
23+
goto, single
2424
}
2525
return
2626

2727
single:
2828
{
29-
WinSet, AlwaysOnTop, On, A ; Focus
30-
WinSet, Style, -0xC00000, A ; hide title bar
31-
WinSet, Style, -0x800000, A ; hide thin-line border
32-
WinSet, Style, -0x400000, A ; hide dialog frame
33-
WinSet, Style, -0x40000, A ; hide thickframe/sizebox
34-
WinMove, A, , 0, 0, A_ScreenWidth, A_ScreenHeight
29+
WinSet, AlwaysOnTop, On, A
30+
SetWindowBorderless("A")
31+
WinMove, A, , 0, 0, A_ScreenWidth, A_ScreenHeight
3532
}
3633
return
3734

3835
double:
3936
{
40-
WinSet, AlwaysOnTop, Off, A ; Focus
41-
WinSet, Style, +0xC00000, A ; show title bar
42-
WinSet, Style, +0x800000, A ; show thin-line border
43-
WinSet, Style, +0x400000, A ; show dialog frame
44-
WinSet, Style, +0x40000, A ; show thickframe/sizebox
45-
WinMove, A, , 0, 0, 1280, 720
37+
WinSet, AlwaysOnTop, Off, A
38+
WinSet, Style, +0xC00000, A ; show title bar
39+
WinSet, Style, +0x800000, A ; show thin-line border
40+
WinSet, Style, +0x400000, A ; show dialog frame
41+
WinSet, Style, +0x40000, A ; show thickframe/sizebox
42+
WinMove, A, , 0, 0, 1280, 720
4643
}
4744
return

AHK/Fullscreen.ahk

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,14 @@
1-
if not A_IsAdmin
2-
{
3-
Run *RunAs "%A_ScriptFullPath%"
4-
ExitApp
5-
}
1+
#Include %A_ScriptDir%\..\Lib\AHK_Common.ahk
2+
#Include %A_ScriptDir%\..\Lib\WindowManager.ahk
3+
4+
InitScript(true, true) ; UIA + Admin required
5+
66
#NoEnv
77
SetBatchLines -1
88
SetControlDelay -1
9-
ListLines Off
109
#SingleInstance Force
1110
#persistent
1211
#Warn
1312

14-
; Fullscreen Single Key
15-
ToggleFakeFullscreen()
16-
{
17-
CoordMode Screen, Window
18-
static WINDOW_STYLE_UNDECORATED := -0xC40000
19-
static savedInfo := Object() ;; Associative array!
20-
WinGet, id, ID, A
21-
if (savedInfo[id])
22-
{
23-
inf := savedInfo[id]
24-
WinSet, Style, % inf["style"], ahk_id %id%
25-
WinMove, ahk_id %id%,, % inf["x"], % inf["y"], % inf["width"], % inf["height"]
26-
savedInfo[id] := ""
27-
}
28-
else
29-
{
30-
savedInfo[id] := inf := Object()
31-
WinGet, ltmp, Style, A
32-
inf["style"] := ltmp
33-
WinGetPos, ltmpX, ltmpY, ltmpWidth, ltmpHeight, ahk_id %id%
34-
inf["x"] := ltmpX
35-
inf["y"] := ltmpY
36-
inf["width"] := ltmpWidth
37-
inf["height"] := ltmpHeight
38-
WinSet, Style, %WINDOW_STYLE_UNDECORATED%, ahk_id %id%
39-
mon := GetMonitorActiveWindow()
40-
SysGet, mon, Monitor, %mon%
41-
WinMove, A,, %monLeft%, %monTop%, % monRight-monLeft, % monBottom-monTop
42-
}
43-
}
44-
45-
GetMonitorAtPos(x,y)
46-
{
47-
;; Monitor number at position x,y or -1 if x,y outside monitors.
48-
SysGet monitorCount, MonitorCount
49-
i := 0
50-
while(i < monitorCount)
51-
{
52-
SysGet area, Monitor, %i%
53-
if ( areaLeft <= x && x <= areaRight && areaTop <= y && y <= areaBottom )
54-
{
55-
return i
56-
}
57-
i := i+1
58-
}
59-
return -1
60-
}
61-
62-
GetMonitorActiveWindow(){
63-
;; Get Monitor number at the center position of the Active window.
64-
WinGetPos x,y,width,height, A
65-
return GetMonitorAtPos(x+width/2, y+height/2)
66-
}
67-
68-
End::ToggleFakeFullscreen()rrors
13+
; End key toggles fullscreen with multi-monitor support
14+
End::ToggleFakeFullscreenMultiMonitor()

AHK/GUI/GUI_Laptop.ahk

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
; Admin check
2-
if not A_IsAdmin
3-
{
4-
Run *RunAs "%A_ScriptFullPath%"
5-
ExitApp
6-
}
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript(true, true) ; UIA + Admin required
73

8-
; Great directives to have
94
#SingleInstance Force
105
#Persistent
11-
#Warn ; Enable warnings to assist with detecting common errors.
12-
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
13-
14-
; 1-time declarations
15-
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
16-
SetTitleMatchMode, 2
17-
SetTitleMatchMode, Fast
18-
DetectHiddenWindows, On
6+
#NoEnv
7+
#Warn
198
SetBatchLines -1
9+
SetTitleMatchMode, 3
10+
SetTitleMatchMode, Fast
2011

2112
Gui +AlwaysOnTop
2213
Gui, New, -MinimizeBox, My Codes

AHK/GUI/GUI_PC.ahk

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
; Admin check
2-
if not A_IsAdmin
3-
{
4-
Run *RunAs "%A_ScriptFullPath%"
5-
ExitApp
6-
}
7-
8-
; Great directives to have
1+
#Include %A_ScriptDir%\..\..\Lib\AHK_Common.ahk
2+
InitScript(true, true) ; UIA + Admin required
3+
94
#SingleInstance Force
105
#Persistent
11-
#Warn ; Enable warnings to assist with detecting common errors.
12-
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
6+
#NoEnv
7+
#Warn
138
SetBatchLines -1
14-
15-
; 1-time declarations
16-
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
179
SetTitleMatchMode, 3
1810
SetTitleMatchMode, Fast
1911

0 commit comments

Comments
 (0)