Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Вопрос [AHK] вращение мышки по кругу.

Как пример
Код:
Expand Collapse Copy
$*Space:: ; press space, then move the mouse, then release space
MouseGetPos, baseX, baseY
Keywait, Space
Speed = 15 ; also effects the accuracy of the circle, be careful
Clockwise := true
SetDefaultMouseSpeed, 0
MouseGetPos, offsetX, offsetY
dx := offsetX - baseX
dy := (-offsetY + baseY) * (!Clockwise*2-1)
offsetR := (dx = 0) ? (0.25+(dy>0)/2) : (ATan(dy/dx)/6.2831853+(dx<0)/2+(dx>0 && dy<0))
SetBatchLines, -1
while, !GetKeyState("MButton", "P") ; hold button to stop
{
    Loop, % slices := Ceil( (10/speed) * Dist := Sqrt(dx**2 + dy**2) )
        MouseMove, % BaseX + Dist * Cos(6.2831853*(A_Index / slices + offsetR))
        , % baseY - (!Clockwise*2-1) * Dist * Sin(6.2831853*(A_Index / slices + offsetR))
}
return
 
p::
MouseGetPos, centerX, centerY
radius := 200
points := 36

Loop, %points% {
angle := (A_Index - 1) * (2 * 3.14159 / points)
Click down left
x := centerX + radius * Cos(angle)
y := centerY + radius * Sin(angle)
MouseMove, %x%, %y%, 0
}

Click up left
ExitApp
return

Esc::ExitApp
 
Назад
Сверху Снизу