Log in

View Full Version : [WoW] Mouse Button 4 and 5 Cloning using AutoHotKey



crecsky
09-14-2012, 03:50 PM
Hello,

I'm having a hell of a time figuring this out. I am dual-boxing wow and I would like for my 4th and 5th mouse buttons to clone from one screen to the other as I have them used in keybindings with make my game play much smoother. Basically I found this script and the last part is what I can't get working. This isn't the whole thing, just an example to get you going. Hopefully I am just missing something stupid.

Thanks.


#IfWinActive, World of Warcraft
~1::
ControlSend,,{1 down}{1 up}, ahk_id %idMain%
ControlSend,,{= down}{= up}, ahk_id %idClone%
ControlSend,,{1 down}{1 up}, ahk_id %idClone%
return

#IfWinActive, World of Warcraft
~XButton2::
ControlClick,, ahk_id %idMain%,, X2
ControlSend,,{= down}{= up}, ahk_id %idClone%
ControlClick,, ahk_id %idClone%,, X2
return

I guess I could use a workaround:
Set keybindings on the Clone window to F5 and F4 and have XButton2 and XButton1 send those keyboard keys.


#IfWinActive, World of Warcraft
~X2::
ControlSend,,{XButton2 down}{XButton2 up}, ahk_id %idMain%
ControlSend,,{= down}{= up}, ahk_id %idClone%
ControlSend,,{F5 down}{F5 up}, ahk_id %idClone%
return

Although I don't know if this scripts theory is correct as I don't have the means to test it at the moment.

Also, do I need the ControlSend for the main window? If I were to remove that would it not still send that command to my Main as well as send the keystroke to the Clone?

daanji
09-14-2012, 07:32 PM
I do not understand this sudden resurgence of AutoHotKey. People stopped using it seriously for Multiboxing 6 years ago.

There are plenty of free and paid options that are available that are better suited.

I honestly recommend buying KeyClone or IsBoxer. For the money you spend, you save HOURS of time. And to me at least, my time is far more valuable.

JohnGabriel
09-14-2012, 08:09 PM
I do not understand this sudden resurgence of AutoHotKey. People stopped using it seriously for Multiboxing 6 years ago.
[..snip..]

AutoHotKey is alphabetically first in all lists of boxing software. For people that see a boxer for the first time and go to the WoW Wiki (or wherever) to learn about it, its the first thing they will try, its the first on the list.

daanji
09-14-2012, 10:48 PM
AutoHotKey is alphabetically first in all lists of boxing software. For people that see a boxer for the first time and go to the WoW Wiki (or wherever) to learn about it, its the first thing they will try, its the first on the list.

You raise a very good point. I think this means we should move the AutoHotKey away from the top and put one of the KeyClone, IsBoxer, Octopus, or one of the newbie multiboxing guides at the very very top.

I think beginners starting out with AutoHotKey is doing them a disservice, but perhaps I am just an old man and biased.

F9thRet
09-14-2012, 11:50 PM
John is right. It was the first program I used, when I first started down this road a long time ago. The thing is, It's a good program, but not for the light hearted. Never did try Octopus myself, But key clone or ISboxer is the way to go these days. Maybe Game commander pro, but it's been a long time since I even used that.

Ok, now that we have officially hijacked this mans thread...

The workaround should work, but it's been years since I done any scripting with AHK. Seems to me , that back then, I was able to use that second type set up to run on the old Nostromo pad.

Stephen

Khatovar
09-15-2012, 01:16 AM
I agree about AHK since 90% of the stuff you're going to find for it is for botting, but I personally tried not to play favorites when I made my guides.

F9thRet
09-15-2012, 02:06 AM
Shoot Khat, no one would ever think otherwise, esp. with your guides. you've always been impartial when relaying info.

Stephen

aasi888
09-15-2012, 10:14 AM
You can remove the Controlsend for main since you use ~infront of all the hotkeys.


The send for Main is only needed when you remove the "~" sign.

aasi888
09-17-2012, 04:05 PM
IF your controlclick works please help me to get it work!
I can't for the life of it get control click to work at all.

Currently using Mousemove method in my script. It works from the main window with all resolutions. All boxes must be visible since I can't get controlclick to work. Note if your controlclick actually sends the command to other windows could you post your script so I can test if it works for me? Thx



esc::
KeyWait, esc, D
WinGet, WowWinId, List, World of Warcraft
coordmode, mouse, relative
MouseGetPos, x, y
WinGetPos, winX1, winY1, winWidth1, winHeight1, ahk_id %WowWinId1%
Xratio:= x/winWidth1
Yratio:= y/winHeight1
;msgbox,Xratio:%Xratio% Yratio:%Yratio%`n`x:%x% y:%y% `n` winWidth1:%winWidth1% winWidth1%winWidth1%
WinGet, Active_Window, ID, A
Loop, %WowWinId%
{
target_window := WowWinId%A_index%
;IFWinActive, ahk_id %target_window%
{
Loop, %WowWinId%
{
target_window := WowWinId%A_index%
; window loc | Frame width/height
; | | |
; v | v
WinGetPos, winX%A_index%, winY%A_index%, winWidth%A_index%, winHeight%A_index%, ahk_id %target_window%
}
;MsgBox, x:%x%`n` y:%y%`n` Xratio:%Xratio%`n `Yratio:%Yratio%`n` winX1:%winX1% winY1:%winY1%`n` winX2:%winX2% winY2:%winY2%`n` winX3:%winX3% winY3:%winY3%`n` winX4:%winX4% winY4:%winY4%`n` winX5:%winX5% winY5:%winY5%`n` winX6:%winX6% winY6:%winY6%`n` winX7:%winX7% winY7:%winY7%`n` winX8:%winX8% winY8:%winY8%`n` winX9:%winX9% winY9:%winY9%`n` winX10:%winX10% winY10:%winY10%
}
x_click:=winX%A_index%+Xratio*winWidth%A_index% ;Calculate x location on the screen
y_click:=winY%A_index%+Yratio*winHeight%A_index% ; -||- y
;relative_x:=Xratio*winWidth%A_index% ;Calculate x location on the currently open window
;relative_y:=Yratio*winHeight%A_index% ; -||- y
SetControlDelay,-1
SetMouseDelay, 1
SetDefaultMouseSpeed, 10 ;Values 0-100
coordmode, mouse, screen
mousemove,%x_click%,%y_click%
sleep 200
;coordmode, mouse, relative
;ControlClick, %relative_x% %relative_y%, ahk_id %target_window%,, LEFT, 1, NA
;MsgBox, winX%A_index% winY%A_index% `n`winWidth%A_index% winHeight%A_index%`n`x_click:%x_click% y_click%y_click% `n`Xratio%Xratio% Yratio%Yratio%
}
Return


NOTE: This is not a final version, but a slow version so I can debug it more easily.

EDIT: couldnt get it to work reliably. im gonna use macros or HKN

Ualaa
09-24-2012, 11:34 PM
I'm not sure on the AHK code.

With IS Boxer, mouse buttons generally work better if they're the trigger or hotkey for the action.
But if they output a key combination to the game.

If you want to trigger an ability, with the mouse.
Put the ability on a keybind.
And then use the mouse as the input which triggers an action, that sends the keybind to the game.