Hello, this is my first post. I would like to control multiple windows of separate VisualBoyAdvance emulator executables at the same time. So when i press F1 i want it to affect all vba windows and not just the active one (that i last clicked on). So ive been trying to write a script for that but im not a programmer at all and didnt find a solution in the tutorial either. This is what i have so far, i tried modifying a script wow players used for multiboxing:
Description from the website i found it on (the post/article is about 10 years old): "Although it does take a bit to set up, this is an example of setting up the "2" key to be sent to both World of Warcraft clients."
WinGet, wowid, List, World of Warcraft
~2::
KeyWait 2
IfWinActive, World of Warcraft
{
ControlSend,, 2, ahk_id %wowid1%
ControlSend,, 2, ahk_id %wowid2%
Return
}
////// BELOW is the modified version i tried :
WinGet, wowid, List, VisualBoyAdvance emulator
~9::
KeyWait 2
IfWinActive, VisualBoyAdvance emulator
{
ControlSend,, {F1}, ahk_id %wowid1%
ControlSend,, {F1}, ahk_id %wowid2%
Return
}
Escape::
ExitApp
Return
Needless to say its not working. Before i ask any more specific questions, how would you guys go about this? In principle i thought something like this:
(key that triggers it)
(a send command) (what to send) (where to send it, maybe filepath to the executable)
(same as above but for other executables)
Return
Sending keystrokes to multiple windows
Re: Sending keystrokes to multiple windows
Solved. Code:
WinGet, ID, List, VisualBoyAdvance
$9::
; KeyWait, 9
IfWinActive, VisualBoyAdvance
{
Loop, %ID%
{
X := ID%A_Index%
ControlSend,, {F1}, ahk_id %X%
}
}
Return
Escape::ExitApp
WinGet, ID, List, VisualBoyAdvance
$9::
; KeyWait, 9
IfWinActive, VisualBoyAdvance
{
Loop, %ID%
{
X := ID%A_Index%
ControlSend,, {F1}, ahk_id %X%
}
}
Return
Escape::ExitApp
Who is online
Users browsing this forum: -Elaphe-, downstairs, Frogrammer and 286 guests