AHK & Windows 10, scripts not working in fullscreen games

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
risker
Posts: 3
Joined: 01 Aug 2015, 06:42

AHK & Windows 10, scripts not working in fullscreen games

01 Aug 2015, 06:50

I'm having issues after upgrading to Windows 10, I have a script for SA:MP. (GTA:SA Multiplayer) Its a fullscreen game. I've tried running the exe file in compatibility mode but the launder crashes whenever the exe is using any compatibility settings.

At first I thought it was maybe due to #ifWinExist/Active but that works fine in text editors. But it won't work in any of my old fullscreen games (Warcraft III & GTA:SA).

Next I decided to try the SA:MP script without these, but still no luck. Scripts are working fine in a text editor but when fullscreen game is activated, nothing works. It may be sendinput that isn't working.

Any suggestions?

Example code that isn't working in the game.

Code: Select all

#IfWinExist, Warcraft III
WheelUp::
Sendinput, {Up down}
sleep, 200
Sendinput, {Up up}
return

XButton1::
Sendinput, {Numpad8}
return
XButton2::
Sendinput, {Numpad7}
return

MButton::
Sendinput, {F1}{F1}
return

^Q::
Sendinput, Q
sleep 5
Sendinput, {click}
return

^W::
Sendinput, W
sleep 5
Sendinput, {click}
return

^E::
Sendinput, E
sleep 5
Sendinput, {click}
return

^R::
Sendinput, R
sleep 5Q
Sendinput, {click}
return

^T::
Sendinput, T
sleep 5
Sendinput, {click}
return

WheelDown::
Sendinput, {Down down}
sleep, 200
Sendinput, {Down up}
return

+LButton::
Send, !{click}
Send, !{click}
Send, !{click}
Sendinput, {enter}[PING]: Retreat from here{!}{enter}
Return

!LButton::
Send, !{click}
Send, !{click}
Sendinput, {enter}[PING]: Attack here{!}{enter}
Return
risker
Posts: 3
Joined: 01 Aug 2015, 06:42

Re: AHK & Windows 10, scripts not working in fullscreen games

02 Aug 2015, 10:22

Yeah that fixed it, I had to compile the script and run it as admin. Thanks Evil.

In-case anyone else has this issue, refer to this post for information on how to work around/with UAC/Admin.

http://www.autohotkey.com/board/topic/5 ... ntry518029
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: AHK & Windows 10, scripts not working in fullscreen games

02 Aug 2015, 10:35

You can get the script to run as admin without compiling.

I use this code, but IIRC there is an easier way to do it now, might wanna ask around

Code: Select all

	run_as_admin(){
		Global 0
		IfEqual, A_IsAdmin, 1, Return 0
		Loop, %0% {
			params .= A_Space . %A_Index%
		}
		DllCall("shell32\ShellExecute" (A_IsUnicode ? "":"A"),uint,0,str,"RunAs",str,(A_IsCompiled ? A_ScriptFullPath
			: A_AhkPath),str,(A_IsCompiled ? "": """" . A_ScriptFullPath . """" . A_Space) params,str,A_WorkingDir,int,1)
		ExitApp
	}
Malice_Unarmed

Re: AHK & Windows 10, scripts not working in fullscreen games

27 May 2017, 17:21

Thanks, yea was having the same issue on Win10, script would work fine on desktop but when entering a game it didn't register, tab out and works fine, go back nadda. Ran as admin and works as it should.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Aqualest, Joey5 and 158 guests