Code: Select all
Z::
loop 10000 {
Random, time, 1000, 10000
SetTitleMatchMode, 2
ControlFocus,, ahk_exe Discord.exe
controlSend,,{enter},ahk_exe Discord.exe
controlSend,,{text}!test,ahk_exe Discord.exe
controlSend,,{enter},ahk_exe Discord.exe
Sleep time
}
I'm trying to make a macro that helps me send some texts to discord while its in the background
When I use that part of the code (SetTitleMatchMode, 2
ControlFocus,, ahk_exe Discord.exe)
It sometimes makes me go to the discord tab, making me tab out of my game and making me manually needing to tab in
Anyway to fix this, it randomly tabs me out so I don't understand what's causing the issue
Edit: it just seems like some inconsistencies, since the tab ins only happens once/twice then stops so its just a minor inconvenience