Почти как в видео.
#define #MK_LBUTTON: 0x0001
#define #WM_MOUSEMOVE: 0x0200
#define #WM_LBUTTONDOWN: 0x0201
#define #WM_LBUTTONUP: 0x0202
$arr_hwnd[0] = HGET(INT($_xmax * 0.25), INT($_ymax * 0.5))
$arr_hwnd[1] = HGET(INT($_xmax * 0.75), INT($_ymax * 0.5))
WNDGETINFO($arr_hwnd[0], $left, $top, $width, $height)
SETTHREAD(TH_DUP_MOUSE, 1)
WHILE(#TRUE)
IF(ISKEYDOWN(1) = 1)
$K = 1
WHILE(ISKEYDOWN(1) = 1)
WAITMS(1)
END_CYC
$K = 2
WHILE($K = 2)
WAITMS(1)
END_CYC
END_IF
END_CYC
THREAD(TH_DUP_MOUSE, 0)
$x = $_xmouse - $left
$y = $_ymouse - $top
SWITCH($K)
CASE(0)
SENDMESSAGE($arr_hwnd[1], #WM_MOUSEMOVE, #NULL, $x + ($y * 65536))
CASE(1)
SENDMESSAGE($arr_hwnd[1], #WM_LBUTTONDOWN, #MK_LBUTTON, $x + ($y * 65536))
CASE(2)
SENDMESSAGE($arr_hwnd[1], #WM_LBUTTONUP, #MK_LBUTTON, $x + ($y * 65536))
$K = 0
END_SWITCH
WAITMS(5)
END_THREAD
Если бы я не видел кода из видео, то я бы сделал примерно так.
$arr_hwnd[0] = HGET(INT($_xmax * 0.25), INT($_ymax * 0.5))
$arr_hwnd[1] = HGET(INT($_xmax * 0.75), INT($_ymax * 0.5))
WNDGETINFO($arr_hwnd[0], $left, $top, $width, $height)
STRSEPARATE("0:0x0200:0x0000:1:0x0201:0x0001:0:0x0202:0x0001:1:0x0200:0x0000", ":", $arr_state)
WHILE(#TRUE)
$i = $state * 6 + ISKEYDOWN(1) * 3
$state = $arr_state[$i]
SENDMESSAGE($arr_hwnd[1], $arr_state[$i + 1], $arr_state[$i + 2], ($_xmouse - $left) + (($_ymouse - $top) * 65536))
END_CYC