Log in

View Full Version : AutoHotKey problem?



Dualbox
12-10-2007, 04:21 PM
Hello there, im new to the dual-boxing thing. All I can say is that it has breathed new life into wow for me. I have never had some much fun. Im dual instancing on one pc. I am having a problem with autohotkey (i guess). If i push a key that does not have a macro/spell on my action bar but i have one on the clone the clone does not recieve the key press and the marco/spell on the clone action bar will not get pressed.

below is my script that i got from the autohotkey help forum and edited to fit my needs. i still need to look into it more and learn more about it.

Any help i do appricate, Thank you and this place is awesome

[code:1];
; Wow Duel Account Helper Version: .02a
; Language: English
; Platform: AutoHotkey Script
; Author: Sorn
; NOTES: Written for the Duel-Boxing.com forums, Send PM or post in the Autohotkey thread for assistance or suggestions
;
; Script Function:
; Allows you to play two copies of WOW at the same time
;

;Tell user what is about to happen
SplashTextOn, 325, , Preparing to find your Main and Clone windows of WoW.
Sleep, 2000
SplasHtextoff

;Grab unique window ID's
WinGet, wowid, List, World of Warcraft

; Minimize All WOW windows
WinMinimize, ahk_id %wowid1%
WinMinimize, ahk_id %wowid2%

;Determine Main and Clone Windows
WinActivate, ahk_id %wowid1%

MsgBox, 4,, Is this your WOW Main window? (press Yes or No)
IfMsgBox Yes
idMain = %wowid1%
else
idMain = %wowid2%

If idMain = %wowid1%
{
idClone = %wowid2%
} else {
idClone = %wowid1%
}

;Activate All WOW windows
WinActivate, ahk_id %idMain%
WinActivate, ahk_id %idClone%


;*** Special Functions ***

#IfWinActive, World of Warcraft
; *** Makes wow2 follow Wow1 Player ***
^-::
ControlSend,,{- down}{- up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
; *** Makes wow2 Assist Wow1 Player ***
^=::
ControlSend,,{= down}{= up}, ahk_id %idClone%
return

; *******************
; *** Hotbars 1-0 ***
; *******************
#IfWinActive, World of Warcraft
~1::
ControlSend,,{1 down}{1 up}, ahk_id %idMain%
ControlSend,,{1 down}{1 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~2::
ControlSend,,{2 down}{2 up}, ahk_id %idMain%
ControlSend,,{2 down}{2 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~3::
ControlSend,,{3 down}{3 up}, ahk_id %idMain%
ControlSend,,{3 down}{3 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~4::
ControlSend,,{4 down}{4 up}, ahk_id %idMain%
ControlSend,,{4 down}{4 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~5::
ControlSend,,{5 down}{5 up}, ahk_id %idMain%
ControlSend,,{5 down}{5 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~6::
ControlSend,,{6 down}{6 up}, ahk_id %idMain%
ControlSend,,{6 down}{6 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~7::
ControlSend,,{7 down}{7 up}, ahk_id %idMain%
ControlSend,,{7 down}{7 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~8::
ControlSend,,{8 down}{8 up}, ahk_id %idMain%
ControlSend,,{8 down}{8 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~9::
ControlSend,,{9 down}{9 up}, ahk_id %idMain%
ControlSend,,{9 down}{9 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~0::
ControlSend,,{0 down}{0 up}, ahk_id %idMain%
ControlSend,,{0 down}{0 up}, ahk_id %idClone%
return



; ***************************
; *** Hotbars Shift ^ 1-0 ***
; ***************************
#IfWinActive, World of Warcraft
~+1::
ControlSend,,{Shift down}{1 down}{1 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{1 down}{1 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+2::
ControlSend,,{Shift down}{2 down}{2 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{2 down}{2 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+3::
ControlSend,,{Shift down}{3 down}{3 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{3 down}{3 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+4::
ControlSend,,{Shift down}{4 down}{4 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{4 down}{4 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+5::
ControlSend,,{Shift down}{5 down}{5 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{5 down}{5 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+6::
ControlSend,,{Shift down}{6 down}{6 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{6 down}{6 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+7::
ControlSend,,{Shift down}{7 down}{7 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{7 down}{7 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+8::
ControlSend,,{Shift down}{8 down}{8 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{8 down}{8 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+9::
ControlSend,,{Shift down}{9 down}{9 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{9 down}{9 up}{Shift up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~+0::
ControlSend,,{Shift down}{0 down}{0 up}{Shift up}, ahk_id %idMain%
ControlSend,,{Shift down}{0 down}{0 up}{Shift up}, ahk_id %idClone%
return

; **************************
; *** Hotbars Cntl ^ 1-0 ***
; **************************
#IfWinActive, World of Warcraft
~^1::
ControlSend,,{Ctrl down}{1 down}{1 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{1 down}{1 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^2::
ControlSend,,{Ctrl down}{2 down}{2 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{2 down}{2 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^3::
ControlSend,,{Ctrl down}{3 down}{3 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{3 down}{3 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^4::
ControlSend,,{Ctrl down}{4 down}{4 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{4 down}{4 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^5::
ControlSend,,{Ctrl down}{5 down}{5 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{5 down}{5 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^6::
ControlSend,,{Ctrl down}{6 down}{6 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{6 down}{6 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^7::
ControlSend,,{Ctrl down}{7 down}{7 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{7 down}{7 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^8::
ControlSend,,{Ctrl down}{8 down}{8 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{8 down}{8 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^9::
ControlSend,,{Ctrl down}{9 down}{9 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{9 down}{9 up}{Ctrl up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~^0::
ControlSend,,{Ctrl down}{0 down}{0 up}{Ctrl up}, ahk_id %idMain%
ControlSend,,{Ctrl down}{0 down}{0 up}{Ctrl up}, ahk_id %idClone%
return

~Mbutton::
#IfWinActive, World of Warcraft
ControlSend,,{Alt down}{= down}{= up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{= down}{= up}{Alt up}, ahk_id %idClone%
return

~Xbutton2::
#IfWinActive, World of Warcraft
ControlSend,,{Alt down}{- down}{- up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{- down}{- up}{Alt up}, ahk_id %idClone%
return


; **********************************
; *** Hotbars LShift&caps 1-0 -,= *** PS: (UNTESTED, seems buged)
; **********************************


Ctrl & 1::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{1 down}{1 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{1 down}{1 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 2::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{2 down}{2 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{2 down}{2 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 3::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{3 down}{3 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{3 down}{3 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 4::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{4 down}{4 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{4 down}{4 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 5::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{5 down}{5 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{5 down}{5 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 6::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{6 down}{6 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{6 down}{6 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 7::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{7 down}{7 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{7 down}{7 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 8::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{8 down}{8 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{8 down}{8 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 9::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{9 down}{9 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{9 down}{9 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & 0::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{0 down}{0 up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{0 down}{0 up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & -::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{- down}{- up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{- down}{- up}{ctrl up}, ahk_id %idClone%
}
return

Ctrl & =::
KeyWait, ctrl, D
#IfWinActive, World of Warcraft
{
ControlSend,,{ctrl down}{= down}{= up}{ctrl up}, ahk_id %idMain%
ControlSend,,{ctrl down}{= down}{= up}{ctrl up}, ahk_id %idClone%
}
return


shift & 1::
KeyWait, shift
#IfWinActive, World of Warcraft
{
ControlSend,,{shift down}{1 down}{1 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{1 down}{1 up}{shift up}, ahk_id %idClone%
}
return

shift & 2::
KeyWait, shift
#IfWinActive, World of Warcraft
{
ControlSend,,{shift down}{2 down}{2 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{2 down}{2 up}{shift up}, ahk_id %idClone%
}
return

shift & 3::
KeyWait, shift
#IfWinActive, World of Warcraft
{
ControlSend,,{shift down}{3 down}{3 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{3 down}{3 up}{shift up}, ahk_id %idClone%
}
return


; **********************************
; *** Hotbars Shift 1-0 -,= *** PS: (seems to work as intended)
; **********************************
; *** Begin Action Shift Bar sequence ***


~Shift & 4::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{4 down}{4 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{4 down}{4 up}{shift up}, ahk_id %idClone%
return

~Shift & 5::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{5 down}{5 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{5 down}{5 up}{shift up}, ahk_id %idClone%
return

~Shift & 6::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{6 down}{6 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{6 down}{6 up}{shift up}, ahk_id %idClone%
return

~Shift & 7::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{7 down}{7 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{7 down}{7 up}{shift up}, ahk_id %idClone%
return

~Shift & 8::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{8 down}{8 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{8 down}{8 up}{shift up}, ahk_id %idClone%
return

~Shift & 9::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{9 down}{9 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{9 down}{9 up}{shift up}, ahk_id %idClone%
return

~Shift & 0::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{0 down}{0 up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{0 down}{0 up}{shift up}, ahk_id %idClone%
return

~Shift & -::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{- down}{- up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{- down}{- up}{shift up}, ahk_id %idClone%
return

~Shift & =::
#IfWinActive, World of Warcraft
ControlSend,,{shift down}{= down}{= up}{shift up}, ahk_id %idMain%
ControlSend,,{shift down}{= down}{= up}{shift up}, ahk_id %idClone%
return



; ************************************************** *******************
; *** Hotbars Client Movement ,, Jump, Strafe left right, Split toons ***
; ************************************************** *******************
; *** Begin Action Movement sequence ***

~space::
#IfWinActive, World of Warcraft
ControlSend,,{space down}{space up}, ahk_id %idMain%
ControlSend,,{space down}{space up}, ahk_id %idClone%
return

~f::
#IfWinActive, World of Warcraft
{
ControlSend, , {f Down}, ahk_id %idMain%
ControlSend, , {f Down}, ahk_id %idClone%
}
Return

~f Up::
#IfWinActive, World of Warcraft
{
ControlSend, , {f Up}, ahk_id %idMain%
ControlSend, , {f Up}, ahk_id %idClone%
}
Return

~e::
#IfWinActive, World of Warcraft
{
ControlSend, , {e Down}, ahk_id %idMain%
ControlSend, , {e Down}, ahk_id %idClone%
}
Return

~e Up::
#IfWinActive, World of Warcraft
{
ControlSend, , {e Up}, ahk_id %idMain%
ControlSend, , {e Up}, ahk_id %idClone%
}
Return

~q::
#IfWinActive, World of Warcraft
{
ControlSend, , {q Down}, ahk_id %idMain%
ControlSend, , {q Down}, ahk_id %idClone%
}
Return

~q Up::
#IfWinActive, World of Warcraft
{
ControlSend, , {q Up}, ahk_id %idMain%
ControlSend, , {q Up}, ahk_id %idClone%
}
Return


~v::
#IfWinActive, World of Warcraft
{
ControlSend, , {v Down}, ahk_id %idMain%
ControlSend, , {v Down}, ahk_id %idClone%
}
Return

~v Up::
#IfWinActive, World of Warcraft
{
ControlSend, , {v Up}, ahk_id %idMain%
ControlSend, , {v Up}, ahk_id %idClone%
}
Return

~z::
#IfWinActive, World of Warcraft
{
ControlSend, , {z Down}, ahk_id %idMain%
ControlSend, , {z Down}, ahk_id %idClone%
}
Return

~z Up::
#IfWinActive, World of Warcraft
{
ControlSend, , {z Up}, ahk_id %idMain%
ControlSend, , {z Up}, ahk_id %idClone%
}
Return



;************************************************* *********

;COordinats scripted action

~LButton::
; ROW 1
If MouseInRange(895,930,290,320)
{
ControlSend,,{Alt down}{1 down}{1 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{1 down}{1 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,330,356)
{
ControlSend,,{Alt down}{2 down}{2 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{2 down}{2 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,365,390)
{
ControlSend,,{Alt down}{3 down}{3 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{3 down}{3 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,402,430)
{
ControlSend,,{Alt down}{4 down}{4 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{4 down}{4 up}{Alt up}, ahk_id %idClone%
}


else If MouseInRange(895,930,440,470)
{
ControlSend,,{Alt down}{5 down}{5 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{5 down}{5 up}{Alt up}, ahk_id %idClone%
}


else If MouseInRange(895,930,475,505)
{
ControlSend,,{Alt down}{6 down}{6 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{6 down}{6 up}{Alt up}, ahk_id %idClone%
}


else If MouseInRange(895,930,510,540)
{
ControlSend,,{Alt down}{7 down}{7 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{7 down}{7 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,545,575)
{
ControlSend,,{Alt down}{8 down}{8 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{8 down}{8 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,583,615)
{
ControlSend,,{Alt down}{9 down}{9 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{9 down}{9 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,620,650)
{
ControlSend,,{Alt down}{0 down}{0 up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{0 down}{0 up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,657,690)
{
ControlSend,,{Alt down}{- down}{- up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{- down}{- up}{Alt up}, ahk_id %idClone%
}

else If MouseInRange(895,930,693,725)
{
ControlSend,,{Alt down}{= down}{= up}{Alt up}, ahk_id %idMain%
ControlSend,,{Alt down}{= down}{= up}{Alt up}, ahk_id %idClone%
}


; ROW 2


MouseInRange(minx,maxx,miny,maxy)
{
MouseGetPos, x, y
If (y >= miny) and (y <= maxy) and (x >= minx) and (x <= maxx)
Return 1
Return 0
}[/code:1]

thinus
12-10-2007, 06:48 PM
Hi,

Things to note about that script:
- : your follow macro should be bound to the minus key on your clone
= : your assist key should be bound to the equal sign

[code:1]#IfWinActive, World of Warcraft
~1::
ControlSend,,{1 down}{1 up}, ahk_id %idMain%
ControlSend,,{1 down}{1 up}, ahk_id %idClone%
return[/code:1]

The "~1" tells AHK to pass the "1" key through to the currently active window. The following two lines (ControlSend) will send the "1" key to the main and the clone windows. In other words, your main ends up getting the keypress twice if you have it active.

If you get a lot of "There is an action already in progress" messages then this is why.

Which hotkeys are you having trouble with?

Eteocles
12-10-2007, 06:49 PM
#IfWinActive, World of Warcraft
~Space::
ControlSend,,{Space down}{Space up}, ahk_id %idClone%
return
#IfWinActive, World of Warcraft
~e::
ControlSend,,{e down}, ahk_id %idClone%
return
~e up::
ControlSend,,{e up}, ahk_id %idClone%
return

If you're just using a hotkey you press once, like a normal hotkey, use the layout Space uses; if you want it to last as long as you hold it down(eg; for movement keys) use the E example's layout, though you can add in the extra line for %idMain% if you want, as my code will only work with the Main up front.

I see the layout you have alot, I'm assuming you used the editor program to make it, while I simply copied and pasted from other lines and tweaked in Notepad till it worked lol; either way, give the above layout(s) a shot, substituting your hotkeys and see if either of those works

There's also the possibility that WoW itself doesn't recognize it as a valid key and thus ignores it, as I tried to press alt+2(my assist macro on alt, Healing Touch on Druid/main window) while in catform on my druid and my alt didn't set follow, but I don't remember if I had simply forgotten to reenable my script or not lol