Log in

View Full Version : Broadcasting Mouse Clicks on 1 PC



Lokked
12-24-2007, 05:00 AM
I provide to you a complicated and mostly Fill-In-For-Your-Situation sort of guide for broadcasting mouse clicks to various windows on a single PC, and you will probably need to be some sort of engineer to understand it, but here goes....

In order for you to use Targetted AE abilities, like Blizzard, Shadowfury, etc, when Dual-Boxing with a single PC, you will need:

1. AutoHotKey installed.
2. All your toons to be facing the same direction, with the same camera angle and pitch. This can be done via ingame commands.
3. An intermediate degree of math knowledge.
4. I *think* this only works with 2 monitors set up in Horizontal View. I really don't know. I'm positive I can make it work across multiple monitors set up any way, but I need to test more.

The Code:

C::
BlockInput, On
CoordMode, Mouse, Screen
MouseGetPos, X, Y
MouseClick
MouseClick, Left, (((X-Q)/W)*(E)+R), (((Y-A)/S)*(D)+F), 2, 0
MouseClick, Left, X, Y,, 0
BlockInput, Off
return


What this will accomplish is upon pressing C (you can set it to whatever you like) your mouse will click itself on its current position (in your Main WoW window) and then in the same proportional position on your Alt WoW windows, depending on how you alter the above code.

So if casting Blizzard for example, you would hit your hotkey to activate blizzard on your Main + Alts, position your mouse on your Main's window where you would like to Blizzard, then run this script by pressing C.

All of the below Variables can be found using Window Spy, which comes with AutoHotKey.

The Variables Q, W, E, R, A, S, D and F:
Q - The value in pixels of the X-coordinate of your main WoW window relative to the left edge of the screen. If your main display takes up a whole monitor and is the left most window, touching the edge of the screen, this value is probably 0.

W - The value in pixels of the width of your main display. For example, if your main WoW window is taking up a whole monitor, whose resolution is 1280x1024, then the width would be 1280.

E - The value in pixels of the width of your Alt window. You can find it using Window Spy by taking the value of the X coord at the left and right edge of the window and subtracting them.

R - The value in pixels from the left most edge of your Alt window to the left most edge of your left most screen. You can find this using Window Spy.

A - The value in pixels of the Y-coordinate of your main WoW window relative to the Top edge of the screen. If your main display takes up a whole monitor and is the Top most window, touching the edge of the screen, this value is probably 0.

S - The value in pixels of the Length of your main display. For example, if your main WoW window is taking up a whole monitor, whose resolution is 1280x1024, then the width would be 1024.

D - The value in pixels of the Length of your Alt window. You can find it using Window Spy by taking the value of the Y coord at the top and bottom edge of the window and subtracting them.

F - The distance in pixels from the top edge of your Alt window to the top edge of your screen. You can find this using Window Spy. In general, for a screen divided into 4 WoW windows, the top 2 windows' F-value will be 0, and the bottom 2 windows' F-value will be half of your Y-Resolution (in 1280x1024, half of 1024, or 612).

The above code will function your Main window + 1 other. In order to make it work for more Alts, simply add another of this line:

MouseClick, Left, (((X-Q)/W)*(E)+R), (((Y-A)/S)*(D)+F),, 0

finding the appropriate values for the other Alts' windows. For example, to 5 box, with 1 Main and 4 Alts, you would have 4 of the above lines, all with slightly different values, pertaining to each window.

This only works for Horizontal view. I haven't experimented enough to test on Dual View, or when using a separate video card to render the second monitor. This only works if the mouse travels across the screens on a single resolution relevant to Windows (I think).

I'll test it more and update this.

Good Luck figuring this one out :p

Lokked

Djarid
12-24-2007, 10:04 AM
if you use ControlClick, the coordinates, by default, are relative to the target window / control. This works on multiple monitors as AHK doesn't care where the window is.

This should simplify your equation a little as you can derive a multiplier for the coordinates based on the ratios of the axes of the relevant windows.

Src Max X / Dest Max X = divisor
e.g.
100 / 60 = 1.66r

then divide the X coord by the divisor
e.g
33.3 / 1.66 = 20.06

as you could define the divisors for each axis of each window on script load, this should greatly simplify things