Are there any loose ends to this script #SingleInstance, Force
#MaxThreadsPerHotkey 2

SetTitleMatchMode, 2
SetKeyDelay, -1
CoordMode, Mouse, Screen

Global primaryMonitorWidth := 1920   ; Width of primary monitor
Global secondMonitorWidth := 1920    ; Width of second monitor
Global secondMonitorHeight := 1080   ; Height of second monitor
Global screencenterx := -(secondMonitorWidth // 2)   ; Center x of the second monitor to the left
Global screencentery := (secondMonitorHeight // 2)   ; Center y of the second monitor

F5::
Goto AFKCTest

F6::
ToolTip, GeForceNow Anti-AFK Enabled, 0, 0
Goto GeForceNowAntiAFK

F7::Goto ContinuousEKey

F8::
Goto MetalRun

F9::
Goto StoneRun

F10::
Goto CrystalRun

F11::
Goto WoodRun

AFKCTest:
AFKCToggle := !AFKCToggle
loop
{
    If not AFKCToggle
        break
    Sleep 150
    ControlClick, x%screencenterx% y%screencentery%, GeForce NOW,,,, D Pos
    ControlClick, x%screencenterx% y%screencentery%, GeForce NOW,,,, U Pos
}
return

GeForceNowAntiAFK:
Gui, Submit, NoHide
SetTimer, GeForceNowAntiAFKLoop, 240000
return

GeForceNowAntiAFKLoop()
{
    WinGetPos, X, Y, Width, Height, GeForce NOW
    if ErrorLevel = 0
    {
        WinMove, GeForce NOW,, X, Y + 1
        Sleep, 333
        WinMove, GeForce NOW,, X, Y
    }
}

ContinuousEKey:
EKeyToggle := !EKeyToggle
Loop
{
    If not EKeyToggle
        break
    Send, e
    Sleep, 150
}
return


MetalRun:
    ; Activate GeForce NOW window
    WinActivate, GeForce NOW                       
    Sleep, 450  ; Small delay to ensure activation

    ; Perform actions using Send
    Send, f
    Sleep, 450
    MouseClick, Left, -650, 200
    Sleep, 150
    Send, g
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, R
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, o
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, h
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, f
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    
    Send, {Esc}
    Sleep, 150
    
    MouseClick, Left, 1250, 200

    ; Return to primary monitor and activate "ARK: Ascended"
    primaryMonitorCenterX := 1920 // 2
    primaryMonitorCenterY := 1080 // 2
    MouseMove, %primaryMonitorCenterX%, %primaryMonitorCenterY%, 0
    WinActivate, ArkAscended
Return

StoneRun:
    ; Activate GeForce NOW window
    WinActivate, GeForce NOW                       
    Sleep, 450  ; Small delay to ensure activation

    ; Perform actions using Send
    Send, f
    Sleep, 400
    MouseClick, Left, -650, 200
    Sleep, 150
    Send, d
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, g
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, h
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    Send, {Esc}
    Sleep, 150
    
    MouseClick, Left, 1250, 200

    ; Return to primary monitor and activate "ARK: Ascended"
    primaryMonitorCenterX := 1920 // 2
    primaryMonitorCenterY := 1080 // 2
    MouseMove, %primaryMonitorCenterX%, %primaryMonitorCenterY%, 0
    WinActivate, ArkAscended
Return

CrystalRun:
    ; Activate GeForce NOW window
    WinActivate, GeForce NOW                       
    Sleep, 450  ; Small delay to ensure activation

    ; Perform actions using Send
    Send, f
    Sleep, 450
    MouseClick, Left, -650, 200
    Sleep, 150
    Send, E
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, o
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, f
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, h
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150
    
    Send, {Esc}
    Sleep, 150
    
    MouseClick, Left, 1250, 200

    ; Return to primary monitor and activate "ARK: Ascended"
    primaryMonitorCenterX := 1920 // 2
    primaryMonitorCenterY := 1080 // 2
    MouseMove, %primaryMonitorCenterX%, %primaryMonitorCenterY%, 0
    WinActivate, ArkAscended
Return

WoodRun:
    ; Activate GeForce NOW window
    WinActivate, GeForce NOW                       
    Sleep, 450  ; Small delay to ensure activation

    ; Perform actions using Send
    Send, f
    Sleep, 450
    MouseClick, Left, -650, 200
    Sleep, 150
    Send, R
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    MouseClick, Left, -650, 200
    Sleep, 150
    Send, H
    Sleep, 150
    Send, {Enter}

    MouseClick, Left, -500, 193
    Sleep, 150
    Send, {Enter}
    Sleep, 150

    Send, {Esc}
    Sleep, 150
    
    MouseClick, Left, 1250, 200

    ; Return to primary monitor and activate "ARK: Ascended"
    primaryMonitorCenterX := 1920 // 2
    primaryMonitorCenterY := 1080 // 2
    MouseMove, %primaryMonitorCenterX%, %primaryMonitorCenterY%, 0
    WinActivate, ArkAscended
Return

F12::
    ; Get the process ID of the current script
    Process, Exist
    currPID := ErrorLevel
    
    ; Get a list of all AutoHotkey script windows
    WinGet, winList, List, ahk_class AutoHotkey

    ; Loop through each window handle
    Loop, %winList%
    {
        thisID := winList%A_Index%
        WinGet, thisPID, PID, ahk_id %thisID%
        
        ; If this process is not the current script, terminate it
        if (thisPID != currPID)
        {
            Process, Close, %thisPID%
        }
    }
return