daanji
04-14-2007, 09:40 PM
I'm putting together a setup that uses my existing hardware. I want to play three toons at once. My desktop can easily handle two instances of WoW no problems and my laptop can handle only one. I have multibox setup and it works great. I can also setup Autohotkey on my desktop and that works great.
However, they don't work so well together. I'm trying to get Autohotkey to 'broadcast' to multiple WoW instance while Multibox sends those same commands to the laptop. To get this to work, I'm using the ~ prefix so that the keystrokes are sent to the active window and then I how some logic that loops over all the inactive WoW windows and sends the keystrokes to them.
The main problem that I am experiencing with my Autohotkey script is that the Hotkeys are triggering themselves! Each inactive instance is getting duplicate character. For instance, I type a 1 and the inactive instance receives 11.
When I remove the prefix ~ from the hotkeys, everything works...except Multibox no longer will receive the keystrokes! Arrgghh.
Is there a way to send keystrokes directly to Multibox in AHK?
Can anyone help me refine my AHK script? Here is the code below. In this script I am actually calling Notepad - Untitle as it make it easy to debug.
I have two instances of notepad on one machine and another on the laptop. Multibox is setup properly on both ends.
WinGet, wowid, List, Untitled - Notepad
#UseHook on
inactive_ctrl(key)
{
local id = 0
loop, %wowid%
{
id := wowid%A_index%
IfWinNotActive, ahk_id %id%
{
ControlSend,, %key%, ahk_id %id%
}
}
}
IfWinActive, Untitled - Notepad
{
~1::
inactive_ctrl(1)
Return
~2::
inactive_ctrl(2)
Return
~3::
inactive_ctrl(3)
Return
~4::
inactive_ctrl(4)
Return
~5::
inactive_ctrl(5)
Return
~6::
inactive_ctrl(6)
Return
~7::
inactive_ctrl(7)
Return
~8::
inactive_ctrl(8)
Return
~9::
inactive_ctrl(9)
Return
~0::
inactive_ctrl(0)
Return
~-::
inactive_ctrl("-")
Return
~=::
inactive_ctrl("=")
Return
~+1::
inactive_ctrl(+1)
Return
} ;End IF
However, they don't work so well together. I'm trying to get Autohotkey to 'broadcast' to multiple WoW instance while Multibox sends those same commands to the laptop. To get this to work, I'm using the ~ prefix so that the keystrokes are sent to the active window and then I how some logic that loops over all the inactive WoW windows and sends the keystrokes to them.
The main problem that I am experiencing with my Autohotkey script is that the Hotkeys are triggering themselves! Each inactive instance is getting duplicate character. For instance, I type a 1 and the inactive instance receives 11.
When I remove the prefix ~ from the hotkeys, everything works...except Multibox no longer will receive the keystrokes! Arrgghh.
Is there a way to send keystrokes directly to Multibox in AHK?
Can anyone help me refine my AHK script? Here is the code below. In this script I am actually calling Notepad - Untitle as it make it easy to debug.
I have two instances of notepad on one machine and another on the laptop. Multibox is setup properly on both ends.
WinGet, wowid, List, Untitled - Notepad
#UseHook on
inactive_ctrl(key)
{
local id = 0
loop, %wowid%
{
id := wowid%A_index%
IfWinNotActive, ahk_id %id%
{
ControlSend,, %key%, ahk_id %id%
}
}
}
IfWinActive, Untitled - Notepad
{
~1::
inactive_ctrl(1)
Return
~2::
inactive_ctrl(2)
Return
~3::
inactive_ctrl(3)
Return
~4::
inactive_ctrl(4)
Return
~5::
inactive_ctrl(5)
Return
~6::
inactive_ctrl(6)
Return
~7::
inactive_ctrl(7)
Return
~8::
inactive_ctrl(8)
Return
~9::
inactive_ctrl(9)
Return
~0::
inactive_ctrl(0)
Return
~-::
inactive_ctrl("-")
Return
~=::
inactive_ctrl("=")
Return
~+1::
inactive_ctrl(+1)
Return
} ;End IF