Log in

View Full Version : Formations with autohotkey (want to leave 'main' char out)



Vodka
11-16-2007, 09:28 PM
I am trying to do this setup:

x-y-x
-x-x-

I used the code from the Formations guide, last post in the thread, and modified it abit...

[code:1]
F8::
ControlSend,,{up down}, ahk_id %wowid2%
ControlSend,,{9 down}, ahk_id %wowid2%
ControlSend,,{up down}, ahk_id %wowid3%
ControlSend,,{0 down}, ahk_id %wowid3%
ControlSend,,{9 down}, ahk_id %wowid4%
ControlSend,,{0 down}, ahk_id %wowid5%
Sleep, 250
ControlSend,,{9 up}, ahk_id %wowid4%
ControlSend,,{0 up}, ahk_id %wowid5%
Sleep, 250
ControlSend,,{up up}, ahk_id %wowid2%
ControlSend,,{9 up}, ahk_id %wowid2%
ControlSend,,{up up}, ahk_id %wowid3%
ControlSend,,{0 up}, ahk_id %wowid3%
return[/code:1]

The problem is I have no idea how autohotkey picks windows. I want my main's window to be wowid1, as I can't just randomly switch windows because the resolution on the non-main windows is teeny. But wowid1 always ends up being my warlock no matter what I do, it's freaking weird.

I was looking in the Autohotkey guide and I noticed Sorn's huge script and how it checks for a main and the clone, and am comtemplating on how to go about expanding it to include a 5-wow template.

If anyone has already done this or knows something about how Autohotkey picks windows that I do not, please reply!

And thanks a ton for putting up with all the questions guys, this forum is amazing =)

Vodka
11-16-2007, 10:25 PM
Hmm, I think I figured it out: [EDIT: Found a problem with it, this is corrected version]

[code:1]WinGet, wowid, List, World of Warcraft


WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%
WinMinimize, ahk_id %wowid3%
WinMinimize, ahk_id %wowid4%
WinMinimize, ahk_id %wowid5%



WinActivate, ahk_id %wowid1%

MsgBox, 4,, Is this your WOW Main window? (press Yes or No)

IfMsgBox Yes
{
idMain = %wowid1%
idA = %wowid2%
idB = %wowid3%
idC = %wowid4%
idD = %wowid5%

}
else IfMsgBox No
{

WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%
WinMinimize, ahk_id %wowid3%
WinMinimize, ahk_id %wowid4%
WinMinimize, ahk_id %wowid5%

WinActivate, ahk_id %wowid2%
MsgBox, 4,, Is this your WOW Main window? (press Yes or No)

IfMsgBox Yes
{
idMain = %wowid2%
idA = %wowid1%
idB = %wowid3%
idC = %wowid4%
idD = %wowid5%
}
else IfMsgBox No
{

WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%
WinMinimize, ahk_id %wowid3%
WinMinimize, ahk_id %wowid4%
WinMinimize, ahk_id %wowid5%

WinActivate, ahk_id %wowid3%
MsgBox, 4,, Is this your WOW Main window? (press Yes or No)

IfMsgBox Yes
{
idMain = %wowid3%
idA = %wowid1%
idB = %wowid2%
idC = %wowid4%
idD = %wowid5%
}
else IfMsgBox No
{
WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%
WinMinimize, ahk_id %wowid3%
WinMinimize, ahk_id %wowid4%
WinMinimize, ahk_id %wowid5%

WinActivate, ahk_id %wowid4%
MsgBox, 4,, Is this your WOW Main window? (press Yes or No)

IfMsgBox Yes
{
idMain = %wowid4%
idA = %wowid1%
idB = %wowid2%
idC = %wowid3%
idD = %wowid5%
}
else IfMsgBox No
{
WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%
WinMinimize, ahk_id %wowid3%
WinMinimize, ahk_id %wowid4%
WinMinimize, ahk_id %wowid5%

WinActivate, ahk_id %wowid5%
MsgBox, 4,, Is this your WOW Main window? (press Yes or No)

IfMsgBox Yes
{
idMain = %wowid5%
idA = %wowid1%
idB = %wowid2%
idC = %wowid3%
idD = %wowid4%
}
else IfMsgBox No
{
MsgBox There was an issue determining the main window, please reload script or load another.

}
}
}
}
}
[/code:1]