Log in

View Full Version : Trouble with autohotkey



Ohls
09-12-2007, 12:43 PM
I just cant figure it out =( All I can get to work is this:

[code:1]~1::
KeyWait, 1, D
#IfWinActive, World of Warcraft
{
ControlSend,, 1, ahk_id %wowid1%
ControlSend,, 1, ahk_id %wowid2%
}
Return
[/code:1]

What I'd like is to be able to click something and send something else so another window. Like If I like shift 2, That would return 2 to window 2 and nothing to window 1.

I tried to bind space to both windows but it didnt work either.


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

When I do this only 1 of them jumps and wierd things happen. Open spell book, sit down etc. Like all keys were pressed.

If someone would just provide me with something that I can copy and paste I'll be happy. I doubt I'll ever be able to learn how this works :S.

Thanks!

Team_Supa
09-12-2007, 01:46 PM
..

Ohls
09-12-2007, 06:15 PM
That wasn't what I wanted but I managed to work it out myself anyway.
I wanted to press 1 key, and then make it send another key to 1 of the clients. This is what I came up with:


Shift & v::
KeyWait, shift, D
#IfWinActive, World of Warcraft
{
ControlSend,, v, ahk_id %wowid1%
}

Now I ran into another problem however. The wowid seems to switch all the time. Donnu if it matters in what order I start wow. But it seems to change when I reload the script. Very annoying and it takes like 10 minutes to get the ID right each time I wanna play =/.

Anyone know how to solve it?

Wilbur
09-12-2007, 06:42 PM
You have to define wowID1 and 2 as something else, E.G IDClone, IDMain, then select which one is which using the following script. (http://www.dual-boxing.com/forums2/viewtopic.php?p=4374#4374)

Ohls
09-12-2007, 10:44 PM
You have to define wowID1 and 2 as something else, E.G IDClone, IDMain, then select which one is which using the following script. (http://www.dual-boxing.com/forums2/viewtopic.php?p=4374#4374)

ah, quite a nifty script that!

poking around in that thread I saw some sort of plugin or something for AHK, seems to be developed by sorn. Anyone know what happened with that? Did he give it up?

Wilbur
09-13-2007, 06:02 AM
Not entirely sure. Haven't seen him on the boards for a while.

Team_Supa
09-13-2007, 06:13 AM
do you reload the script once all clients are open and logged in ?

I find this will solve the waiting issue you may be having.

and to remap keys i havent tried it but it would go something like this

This small snippet will remap SHIFT+1 to V

So shift+1 will only go to the first instance of wow open and when you press shift+1 it will send the keypress V to the next instance of wow that is open.

I recently tidied up my code with the wait command so keys dont que when you press them.

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

; *** Begin Action Bar sequence ***

~Shift & 1::
IfWinActive, World of Warcraft
{
ControlSend,,{V down}, ahk_id %wowid1%
ControlSend,,{V down}, ahk_id %wowid2%
KeyWait V
ControlSend,,{V up}, ahk_id %wowid1%
ControlSend,,{V up}, ahk_id %wowid2%
return
} [/code:1]