I'm trying to not click on stuff while I'm gamming

Ask gaming related questions (AHK v1.1 and older)
colbeef
Posts: 2
Joined: 06 Feb 2023, 15:34

I'm trying to not click on stuff while I'm gamming

Post by colbeef » 06 Feb 2023, 15:42

so I've got a picture in picture up while I play destiny 2 and every now and then I'll click on it and it will mess me up. so I was trying to make an ahk to hold my mouse in the middle of my screen then when I go out of the game/into my inventory it will pause and I can't quite figure it out this is what I've got so far

loop {
MouseMove, 825, 540
Sleep, 1
}
F1::Pause

825,540 is the middle of my screen and I want to change F1 to whenever I'm not on the game or in my inventory
Attachments
play d2 with yt.ahk
(58 Bytes) Downloaded 14 times

User avatar
mikeyww
Posts: 26592
Joined: 09 Sep 2014, 18:38

Re: I'm trying to not click on stuff while I'm gamming

Post by mikeyww » 06 Feb 2023, 19:47

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v1.1.33
#SingleInstance Force
winTitle := "ahk_exe notepad.exe"
Loop {
 WinWaitActive % winTitle
 SetTimer Move, 50
 SoundBeep 1500
 WinWaitNotActive
 SetTimer Move, Off
 SoundBeep 1000
}
Move:
MouseMove 825, 540
Return

Code: Select all

#Requires AutoHotkey v2.0
winTitle := "ahk_exe notepad.exe"
move     := () => MouseMove(825, 540)
Loop {
 WinWaitActive winTitle
 SetTimer move, 50
 SoundBeep 1500
 WinWaitNotActive
 SetTimer move, 0
 SoundBeep 1000
}

colbeef
Posts: 2
Joined: 06 Feb 2023, 15:34

Re: I'm trying to not click on stuff while I'm gamming

Post by colbeef » 08 Feb 2023, 23:05

what's soundBeep and do I have to put in the game name for winTitle and how often does it move cut it has to stay in the middle not really move because if it moves too much it will throw off my aim while I'm playing

User avatar
mikeyww
Posts: 26592
Joined: 09 Sep 2014, 18:38

Re: I'm trying to not click on stuff while I'm gamming

Post by mikeyww » 08 Feb 2023, 23:22

You can click on the commands in the posted script to learn more about them. You can alter the timer frequency if you like. The beep is optional. Yes, change the :arrow: WinTitle to match what you need.

Post Reply

Return to “Gaming Help (v1)”