Edit the script so that when F7 is click the mouse moves to the middle of the second…
- User
Edit the script so that when F7 is click the mouse moves to the middle of the second monitors and activates the Geforce NOW window #SingleInstance, Force #MaxThreadsPerHotkey 2
SetTitleMatchMode, 2 SetKeyDelay, -1 CoordMode, Mouse, Screen
Global screencenterx := (A_ScreenWidth // 2) Global screencentery := (A_ScreenHeight // 2)
F5:: Goto AFKCTest
F6:: ToolTip, GeForceNow Anti-AFK Enabled, 0, 0 Goto GeForceNowAntiAFK
F7:: Goto MetalFarm
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 } }
MetalFarm: MouseMove, -650, 200 Click, Left Click, Left Send, f ; Press "f" Sleep, 100 ; Reduced delay MouseMove, -650, 200 ; Move cursor to search Sleep, 50 ; 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 drop Sleep, 50 ; Reduced delay return
- Assistant
- User
second monitor is to the left
- Assistant
If the second monitor is to the left of your primary monitor, you'll need to adjust the
screencenterxcalculation to account for this layout. In this setup, the coordinate for the center of the second monitor should be negative, as it is to the left of the primary monitor's coordinates. - User
Width for both monitors is 1920 and height of second monitor is 1080
- Assistant
Given that both monitors have a width of 1920 pixels and the height of the second monitor is 1080 pixels, and since the second monitor is to the left of the primary monitor, we need to adjust the mouse coordinates accordingly. Here’s how you can update the script: