Skip to content
The Chat Archive
gpt-4o-2024-08-06· OpenAI WildChat-4.8M (AI2)

At the end of the F7 function return to main monitor #SingleInstance, Force…

  1. User

    At the end of the F7 function return to main monitor #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 (might be different if you're using different resolutions) 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 SecondMonitorAndActivate

    AFKCTest: AFKCToggle := !AFKCToggle loop { If not AFKCToggle break Sleep 100 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 } }

    SecondMonitorAndActivate: MouseMove, %screencenterx%, %screencentery% ; Move mouse to center of the second monitor WinActivate, GeForce NOW ; Activate GeForce NOW window MouseMove, -650, 200 ; Move cursor to coordinates (-650, 200) Send, f ; Press "f" Sleep, 300 ; Reduced delay MouseMove, -650, 200 ; Move cursor to coordinates (-650, 200) Sleep, 100 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, g ; Type "g" Sleep, 50 ; Reduced delay Send, {Enter} ; Press Enter Sleep, 100 ; Reduced delay MouseMove, -500, 193 ; Move cursor to coordinates (-500, 193) Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, {Enter} ; Press Enter after left click Sleep, 50 ; Reduced delay MouseMove, -650, 200 ; Move back to (-650, 200) Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, y ; Type "y" Sleep, 50 ; Reduced delay Send, {Enter} ; Press Enter Sleep, 100 ; Reduced delay MouseMove, -500, 193 ; Move to (-500, 193) again Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, {Enter} ; Press Enter after left click Sleep, 50 ; Reduced delay MouseMove, -650, 200 ; Move back to (-650, 200) Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, o ; Type "o" Sleep, 50 ; Reduced delay Send, {Enter} ; Press Enter Sleep, 100 ; Reduced delay MouseMove, -500, 193 ; Move to (-500, 193) again Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, {Enter} ; Press Enter after left click Sleep, 50 ; Reduced delay MouseMove, -650, 200 ; Move back to (-650, 200) Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, h ; Type "h" Sleep, 50 ; Reduced delay Send, {Enter} ; Press Enter Sleep, 100 ; Reduced delay MouseMove, -500, 193 ; Move to (-500, 193) again Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, {Enter} ; Press Enter after left click Sleep, 50 ; Reduced delay MouseMove, -650, 200 ; Move back to (-650, 200) Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, f ; Type "f" Sleep, 50 ; Reduced delay Send, {Enter} ; Press Enter Sleep, 100 ; Reduced delay MouseMove, -500, 193 ; Move to (-500, 193) again Sleep, 50 ; Reduced delay Click, Left ; Left click Sleep, 100 ; Reduced delay Send, {Enter} ; Press Enter after left click Send, {Esc} ; Press Escape to close interface MouseMove, 1250, 200 ; Move back to (1250, 200) Click, Left ; Left click Return

  2. Assistant

    The script you've posted is an AutoHotkey (AHK) script designed to automate some operations related to the GeForce NOW application. Let's break down its functionality and overall purpose:

    1. Configuration:

      • It sets the coordination mode, key delay, and initializes some global variables related to primary and secondary monitor resolutions.
    2. Hotkeys:

      • F5: Toggles a custom AFK (Away From Keyboard) test loop.
      • F6: Activates a GeForce NOW anti-AFK mechanism which involves a periodic movement of the window.
      • F7: Automates a series of mouse clicks and keypresses targeting specific coordinates, likely interacting with the GeForce NOW application or a similar context.
    3. Functions:

      • AFKCTest: Continuously clicks at the center of the secondary screen while toggled.
      • GeForceNowAntiAFK: Sets a timer to "jiggle" the GeForce NOW window to prevent timeouts due to inactivity.
      • SecondMonitorAndActivate: Moves the mouse and simulates keystrokes and clicks on specified screen coordinates for automated interaction with the application.

    How to Use:

    • Running the script will register the functions under the aforementioned hotkeys.
    • Press F5 to start or stop the AFK test.
    • Press F6 to start the anti-AFK timer.
    • Press F7 to execute a predefined sequence of actions aimed at an application window.

    Important Considerations:

    • Monitor Setup: The script is configured with assumptions about the user's monitor setup, including resolutions and the position of applications. These settings may need adjustment to match your actual configuration.
    • Application Window: Make sure the GeForce NOW window is open, named correctly, and positioned as expected for the script to work correctly.
    • Permissions: Ensure you have the necessary permissions to control the application via AHK on your system.
    • Automation Ethics: Consider the ethical implications of using such automation, especially in multiplayer or shared environments, and ensure it aligns with the application's terms of service.

    You can modify the script to adjust coordinates, delays, or window titles according to your needs or to target different applications.