Help with Button GUI for WoW

Post gaming related scripts
remtown
Posts: 4
Joined: 28 Jun 2016, 07:33

Help with Button GUI for WoW

28 Jun 2016, 07:53

So i pieced together this GUI so i could use it in World of Warcraft as i cannot use an average keyboard and i control a mouth operated mouse so i basically have to click everything on the screen due to my physical disability.

It works kind of perfect although the only issue is when i click one of the buttons on the GUI it takes the focus off the WoW window and stops the character from continuing to move until i click the WoW screen again.

Is there a way around this where i can keep the GUI on top, and even when i press a button on the GUI it will keep the focus on WoW window?

Thanks sooooo much, i really appreciate it

Kind Regards!

here's the code

Code: Select all

WinGet, wowid, list, World of Warcraft

#IfWinActive, World of Warcraft

Gui,+AlwaysOnTop

#SingleInstance, Force
CustomColor = 000001
Gui +LastFound +AlwaysOnTop +ToolWindow -Caption +E0x08000000
Gui, Color, %CustomColor%
Gui, Font, s10, Lucida Console

Gui, Add, Text, x0 y0 w115 gGuiMove 0x5

Gui, Show, h321 w218, Test
Gui, Color, 000000
Gui, Font, S15 cRed Bold Italic, Verdana


Gui, Add, Button, h100 w100 x6 y7   gFEAR,FEAR
Gui, Add, Button, h100 w100 x6 y110 gSTUN,STUN
Gui, Add, Button, h100 w100 x6 y213 gRUN,RUN

Gui, Add, Button, h100 w100 x112 y7   gSPACE1,SPACE1
Gui, Add, Button, h100 w100 x112 y110 gSPACE2,SPACE2
Gui, Add, Button, h100 w100 x112 y213 gSPACE3,SPACE3

return




;;;Label's


RUN:
	ControlSend,, {3}, ahk_id %wowid1%
return

STUN:
	ControlSend,, {2}, ahk_id %wowid1%
return

FEAR:
	ControlSend,, {1}, ahk_id %wowid1%
return

SPACE1:
	ControlSend,, {4}, ahk_id %wowid1%
return

SPACE2:
	ControlSend,, {5}, ahk_id %wowid1%
return

SPACE3:
	ControlSend,, {6}, ahk_id %wowid1%
return

;;For drag moving the GUI
GuiMove: 
    PostMessage, 0xA1, 2,,, ahk_class AutoHotkeyGUI
Return
 
GuiClose:
    ExitApp


User avatar
SnowFlake
Posts: 368
Joined: 28 Apr 2015, 05:41
Contact:

Re: Help with Button GUI for WoW

28 Jun 2016, 10:14

try this:
Gui, Show, h321 w218 NoActivate, Test
instead of this:
Gui, Show, h321 w218, Test
:yawn:
remtown
Posts: 4
Joined: 28 Jun 2016, 07:33

Re: Help with Button GUI for WoW

28 Jun 2016, 21:07

SnowFlake wrote:try this:
Gui, Show, h321 w218 NoActivate, Test
instead of this:
Gui, Show, h321 w218, Test

Thanks so much, that is perfect. One other thing is it possible to have the GUI only pop up when World of Warcraft is the main window?

Thanks again. It's perfect!
Shadowpheonix
Posts: 1259
Joined: 16 Apr 2015, 09:41

Re: Help with Button GUI for WoW

29 Jun 2016, 10:05

remtown wrote:Thanks so much, that is perfect. One other thing is it possible to have the GUI only pop up when World of Warcraft is the main window?
Here is how I would do it...

Code: Select all

WinGet, wowid, list, World of Warcraft

SetTimer, ShowMyWoWGui, 250

#IfWinActive, World of Warcraft

Gui,+AlwaysOnTop

#SingleInstance, Force
CustomColor = 000001
Gui +LastFound +AlwaysOnTop +ToolWindow -Caption +E0x08000000
Gui, Color, %CustomColor%
Gui, Font, s10, Lucida Console

Gui, Add, Text, x0 y0 w115 gGuiMove 0x5

;  Gui, Show, h321 w218, Test
Gui, Color, 000000
Gui, Font, S15 cRed Bold Italic, Verdana


Gui, Add, Button, h100 w100 x6 y7   gFEAR,FEAR
Gui, Add, Button, h100 w100 x6 y110 gSTUN,STUN
Gui, Add, Button, h100 w100 x6 y213 gRUN,RUN

Gui, Add, Button, h100 w100 x112 y7   gSPACE1,SPACE1
Gui, Add, Button, h100 w100 x112 y110 gSPACE2,SPACE2
Gui, Add, Button, h100 w100 x112 y213 gSPACE3,SPACE3

return




;;;Label's


RUN:
	ControlSend,, {3}, ahk_id %wowid1%
return

STUN:
	ControlSend,, {2}, ahk_id %wowid1%
return

FEAR:
	ControlSend,, {1}, ahk_id %wowid1%
return

SPACE1:
	ControlSend,, {4}, ahk_id %wowid1%
return

SPACE2:
	ControlSend,, {5}, ahk_id %wowid1%
return

SPACE3:
	ControlSend,, {6}, ahk_id %wowid1%
return

ShowMyWoWGui:
IfWinActive, World Of Warcraft
{
	If Not IsMyWoWGuiShown
	{
		Gui, Show, h321 w218 NoActivate, Test
		IsMyWoWGuiShown := True
	}
}
Else
{
	If IsMyWoWGuiShown
	{
		Gui, Hide
		IsMyWoWGuiShown := False
	}
}
Return

;;For drag moving the GUI
GuiMove: 
    PostMessage, 0xA1, 2,,, ahk_class AutoHotkeyGUI
Return

GuiClose:
    ExitApp

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 66 guests