How to creat a script to only work in my game window?
-
- Posts: 2
- Joined: 25 Sep 2022, 12:53
How to creat a script to only work in my game window?
I just need to run the hotkey only on my game so i can use pc
Re: How to creat a script to only work in my game window?
The easy way for me is by executable
Everything inside #ifWinActive and #if is only executed when blender.exe is focused (the active window, the one that takes mouse and keyboard inputs)
Each game is different (anticheat and things like that) so you need to test.
Code: Select all
#ifWinActive, ahk_exe blender.exe
f1:: Send, +s ; I use F1 to send Shift+S
#if
Each game is different (anticheat and things like that) so you need to test.
-
- Posts: 2
- Joined: 25 Sep 2022, 12:53
Re: How to creat a script to only work in my game window?
@Lepes
sorry it didnt work im very very new to ahk maybe id did something wrong with my script
#SingleInstance, Force
[Mod edit: [code][/code] tags added.]
this is my script where i should put ur code ?
sorry it didnt work im very very new to ahk maybe id did something wrong with my script
#SingleInstance, Force
Code: Select all
6::
loop,
{
Send, k
Sleep, 100
Send, {s Down}
Sleep, 100
Send, {s Up}
Sleep, 100
Send, v
Sleep, 100
Continue
}
Return
7::Reload
8::
ExitApp
this is my script where i should put ur code ?
Re: How to creat a script to only work in my game window?
Code: Select all
#SingleInstance, Force
#ifWinActive, ahk_exe blender.exe
6::
loop,
{
Send, k
Sleep, 100
Send, {s Down}
Sleep, 100
Send, {s Up}
Sleep, 100
Send, v
Sleep, 100
Continue
}
Return
#if
#ifWinActive, ahk_exe Notepad.exe
6:: Send 7 ; teaching how the same hotkey will work different on another program
#if
7::Reload
8::ExitApp
hotkeys 7 and 8 will work on any window