Forum Settings
       
Reply To Thread

AutoHotkey macrosFollow

#1 Oct 11 2008 at 11:58 AM Rating: Good
**
658 posts
I have been casually dual boxing for a while now. The program I used to broadcast my keystrokes is AutoHotKey. I've learned a bit of how to write the macros, but I'm still very newby at it. They all follow this format:

AHK macro wrote:
WinGet, wowid, List, World of Warcraft

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


This will send a 'w' to both of the WoW windows I have open. The trouble I'm having it that this will send the keypress to the current window and to both WoW windows. In most cases this is simply an annoyance. If I'm writing something in the chat box, all my 'w's are doubled, and I have to backspace over them. But in some instances, it adversely affects gameplay. If I have my wand bound to 4, a '4' keypress will activate the wand for both windows, but will automatically de-activate it again for the current one.

Can anyone tell me how to modify the macros so this doesn't happen?
#2 Oct 11 2008 at 12:27 PM Rating: Decent
****
4,684 posts
While I'm far from a programming nerd... It sounds to me like you're also sending the command back to your host PC, else your host wouldn't do the action twice...
#3 Oct 11 2008 at 12:39 PM Rating: Good
**
626 posts
First off, I don't know anything about this kind of thing. However, from a logical point of view, it seems you're giving the w command to your first window twice. One time in the 'normal' fashion, one time through your macro, thus disabling it in your primary window.
#4 Oct 11 2008 at 12:41 PM Rating: Good
***
1,876 posts
Quote:
killbroadcast = 0
WinGet, wowid, List, World of Warcraft

~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
That's copied from the start of my own script. I've modified the script some since I found it, but kept that format. I don't think it passes [ENTER] key strokes, so that the chatting thing doesn't happen. It also doesn't pass "R" or "/" keystrokes to also prevent that.

I, honestly, haven't learned much other than copying the setup of the script I picked up though. Here's a zip with the ahk file in it if you want to take a look -- http://www.cartel-guild.com/Files/wow-bcast.zip
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 522 All times are in CST
Anonymous Guests (522)