Log in

View Full Version : Was wondering if anyone can help with AutoHotKey



mdsjohna
03-03-2010, 11:58 AM
I have the follow script running to broadcast key stroke for my brand new attempt at dual boxing. I am running into two problems. One is the keys I have listed here will go two times into chat. So when I press e it types as ee in the chat window. The other one is the mouse buttons which is supposed to be xbutton1, xbutton2 and mbutton. Don't act like the mouse buttons they end up sitting me down opening maps and other such stuff. It is like they are acting as the x button and the m button repectivly. The e q 1 2 etc buttons do broadcast but the chat issue is annoying. I do have a post in on the website for this program but as I admit I am impatiant and I haven't got a responsive in a day I was wondering if anyone here had any advice on this program or just general advice. A easy to use but semi basic free progam is what I need because I am just starting out and don't want to get too deep incase I decide not to keep going with it.


Thanks in advance



WinGet, wowid, List, World of Warcraft
~q::
KeyWait q
IfWinActive, World of Warcraft
{
ControlSend,, q, ahk_id %wowid1%
ControlSend,, q, ahk_id %wowid2%
Return
}
~e::
KeyWait e
IfWinActive, World of Warcraft
{
ControlSend,, e, ahk_id %wowid1%
ControlSend,, e, ahk_id %wowid2%
Return
}
~xButton1::
KeyWait xButton1
IfWinActive, World of Warcraft
{
ControlSend,, xButton1, ahk_id %wowid1%
ControlSend,, xButton1, ahk_id %wowid2%
Return
}
~xButton2::
KeyWait xButton2
IfWinActive, World of Warcraft
{
ControlSend,, xButton2, ahk_id %wowid1%
ControlSend,, xButton2, ahk_id %wowid2%
Return
}
~mButton::
KeyWait mButton
IfWinActive, World of Warcraft
{
ControlSend,, mButton, ahk_id %wowid1%
ControlSend,, mButton, ahk_id %wowid2%
Return
}
~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
}

mdsjohna
03-03-2010, 03:17 PM
Octopus is quite a bit easier for what I need. No worries I am up and running.

zenga
03-03-2010, 06:24 PM
I have the follow script running to broadcast key stroke for my brand new attempt at dual boxing. I am running into two problems. One is the keys I have listed here will go two times into chat. So when I press e it types as ee in the chat window.

I don't know ahk, but i ran into a similar problem for my linux script. The problem is that you have to make your script detecting the active wow client, and prevent broadcasting for that client. Cause what happens now is that you type a letter in client A, your ahk script detects a keypress and sends the keypress to all clients, i.e. also to the one where you just typed that letter.

in pseudo code:

detect wowwindows and rename/save them in a variable
detect keypress in wow window
if activewindow = a, broadcast keypress to bcde
elseif activewindow = b broadcastkeypress to acde
etc

wowphreak
03-03-2010, 08:58 PM
Whats happening with yer script with the e's is when yeh hit the key it sends it to wow then yeh have yer script send it to yer wow's therefore what ever yeh have in the fore ground gets 2 e's.

CAnt see a reason why it should go to chat dont maybe missing that part figure yeh didnt add yer whole script.

for sending mouse clicks maybe look into http://www.autohotkey.com/docs/commands/Send.htm I never use mouse click for sending things to my other wows I use them for movement.

This will work for any amounts of WOW instances and is much easier to tweak and adds things to



clonepush(strkey)
{
global winid
Loop %winid%
{
tmp:=winid%A_Index%
IfWinNotActive, ahk_id %tmp%
ControlSend, ,%strkey%, ahk_id %tmp%
}
sleep 1
}

WinGet, winid, List, World of Warcraft

;******** this part for all the keys ************
#IfWinActive, World of Warcraft


; *******************
; *** Hotbars keys 1-0 ***
; *******************
~1::clonepush("{1 down}{1 up}")
~2::clonepush("{2 down}{2 up}")
~3::clonepush("{3 down}{3 up}")
~4::clonepush("{4 down}{4 up}")
~5::clonepush("{5 down}{5 up}")
~6::clonepush("{6 down}{6 up}")
~7::clonepush("{7 down}{7 up}")
~8::clonepush("{8 down}{8 up}")
~9::clonepush("{9 down}{9 up}")
~0::clonepush("{0 down}{0 up}")
~-::clonepush("{- down}{- up}")
~=::clonepush("{= down}{= up}")

wowphreak
03-03-2010, 08:59 PM
Whats happening with yer script with the e's is when yeh hit the key it sends it to wow then yeh have yer script send it to yer wow's therefore what ever yeh have in the fore ground gets 2 e's.

CAnt see a reason why it should go to chat maybe missing that part figure yeh didnt add yer whole script.

for sending mouse clicks maybe look into http://www.autohotkey.com/docs/commands/Send.htm I never use mouse click for sending things to my other wows I use them for movement.

This will work for any amounts of WOW instances and is much easier to tweak and adds things to



clonepush(strkey)
{
global winid
Loop %winid%
{
tmp:=winid%A_Index%
IfWinNotActive, ahk_id %tmp%
ControlSend, ,%strkey%, ahk_id %tmp%
}
sleep 1
}

WinGet, wowid, List, World of Warcraft

;******** this part for all the keys ************
#IfWinActive, World of Warcraft


; *******************
; *** Hotbars keys 1-0 ***
; *******************
~1::clonepush("{1 down}{1 up}")
~2::clonepush("{2 down}{2 up}")
~3::clonepush("{3 down}{3 up}")
~4::clonepush("{4 down}{4 up}")
~5::clonepush("{5 down}{5 up}")
~6::clonepush("{6 down}{6 up}")
~7::clonepush("{7 down}{7 up}")
~8::clonepush("{8 down}{8 up}")
~9::clonepush("{9 down}{9 up}")
~0::clonepush("{0 down}{0 up}")
~-::clonepush("{- down}{- up}")
~=::clonepush("{= down}{= up}")




dont have a whole lot of time at the moment to go thru this I'll get back later to clarifing