Log in

View Full Version : Authotkey Help



Dualboxerz
08-16-2008, 01:51 PM
Hello, I use AutoHotKey and I'm new to multiplexers or what not. The problem is I use the following script and it may work once but then the second time, say, I press the '2' key it doesn't go on both WoW applications like before (I am boxing 2 trial accounts to test boxing first). Please if anyone could help, that would be great. I use the following script: Just a simple 1-5 and space bar and it works once and then does not work again, I've tried this alot of times and it only works SOME times? This confuses me..thanks.

WinGet, wowid, List, World of Warcraft

~1::
KeyWait 1
IfWinActive, World of Warcraft
{
ControlSend,, 1, ahk_id %wowid1%
ControlSend,, 1, ahk_id %wowid2%
Return
}

~2::
KeyWait 2
IfWinActive, World of Warcraft
{
ControlSend,, 2, ahk_id %wowid1%
ControlSend,, 2, ahk_id %wowid2%
Return
}

~3::
KeyWait 3
IfWinActive, World of Warcraft
{
ControlSend,, 3, ahk_id %wowid1%
ControlSend,, 3, ahk_id %wowid2%
Return
}

~4::
KeyWait 4
IfWinActive, World of Warcraft
{
ControlSend,, 4, ahk_id %wowid1%
ControlSend,, 4, ahk_id %wowid2%
Return
}

~5::
KeyWait 5
IfWinActive, World of Warcraft
{
ControlSend,, 5, ahk_id %wowid1%
ControlSend,, 5, ahk_id %wowid2%
Return
}


~Space::
KeyWait Space
IfWinActive, World of Warcraft
{
ControlSend,, %A_Space%, ahk_id %wowid1%
ControlSend,, %A_Space%, ahk_id %wowid2%
Return
}

-silencer-
08-16-2008, 02:53 PM
Here's the start of my AHK script for 5-boxing (and it works if I only load 2-4 instances of WoW too).. the rest of the keys continue like the first two listed, just replace the obvious key in the 3 places of each keypress command.



killbroadcast = 0
WinGet, wowid, List, World of Warcraft

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

~Pause::
KeyWait, Pause, D
If(%killbroadcast% = 0)
{
killbroadcast = 1
}
else
{
killbroadcast = 0
WinGet, wowid, List, World of Warcraft
}
Return

~1::
KeyWait 1, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
If(%killbroadcast% = 0)
{
Loop, %wowid%
{
target_window := wowid%A_index%
If (Active_Window <> target_window)
{
ControlSend,, 1, ahk_id %target_window%
}
}
}
}
Return

~2::
KeyWait 2, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
If(%killbroadcast% = 0)
{
Loop, %wowid%
{
target_window := wowid%A_index%
If (Active_Window <> target_window)
{
ControlSend,, 2, ahk_id %target_window%
}
}
}
}
Return


All keys are as above, except F1 (my formation key to spread out). The longer I hold the key, the further apart they spread. This key uses NO sleep/wait type commands, so it can't be classified as automation at all.


~F1::
IfWinActive, World of Warcraft
{
ControlSend, , {F1 Down}, ahk_id %wowid1%
ControlSend, , {F1 Down}, ahk_id %wowid2%
ControlSend, , {F1 Down}, ahk_id %wowid3%
ControlSend, , {F1 Down}, ahk_id %wowid4%
ControlSend, , {F1 Down}, ahk_id %wowid5%
}
Return

~F1 Up::
IfWinActive, World of Warcraft
{
ControlSend, , {F1 Up}, ahk_id %wowid1%
ControlSend, , {F1 Up}, ahk_id %wowid2%
ControlSend, , {F1 Up}, ahk_id %wowid3%
ControlSend, , {F1 Up}, ahk_id %wowid4%
ControlSend, , {F1 Up}, ahk_id %wowid5%
}
Return

Dualboxerz
08-16-2008, 02:59 PM
Thankyou very much for your reply. Unforunately, I am a newbie to AHK script and stuff so I am not sure, do I copy those scripts exactly and it will work? Or do I have to change some things? Thanks alot.



Edit: What I am trying to ask here is what do I have to change to get a script for the 1-5 keys and the space bar keys? And q,e if possible also. If you could provide an example of one and how I should continue that'd be great.

Double Edit: The problem is now solved, thanks for help.