0
我試圖讓鼠標光標從一點移動到另一點。不是在一條直線上,而是在一條曲線中。這裏是an illustrative video。這裏是基於位置移動鼠標的代碼:曲線鼠標移動
func smoothmove($coords,$j,$firstms);make mouse move to the note
dim $currcoord[3]
dim $diff[3]
dim $pixelsptms[3]
if $j > 1 Then
if mod($coords[$j-1][7][1],2) = 0 Then
$currcoord[1] = $coords[$j-1][1][1]
$currcoord[2] = $coords[$j-1][2][1]
Else
$currcoord[1] = $coords[$j-1][1][$coords[$j-1][1][0]]
$currcoord[2] = $coords[$j-1][2][$coords[$j-1][2][0]]
EndIf
Else
$currcoord[1] = mousegetpos(0)
$currcoord[2] = mousegetpos(1)
EndIf
if $coords[$j][1][1] = $currcoord[1] then
if $coords[$j][2][1] = $currcoord[2] then return 1
EndIf
if $coords[$j][3][1] <= $firstms then return 1
$diff[1] = $coords[$j][1][1] - $currcoord[1]
$diff[2] = $coords[$j][2][1] - $currcoord[2]
$pixelsptms[1] = ($diff[1]/($coords[$j][3][1]-$firstms)) * 12
$pixelsptms[2] = ($diff[2]/($coords[$j][3][1]-$firstms)) * 12
dim $ready[5]
$ready[1] = 2
$ready[2] = 3
$ready[3] = 2
$ready[4] = 3
$firstms += 12
$count = 0
while 1
DllCall($osumap[0], 'int', 'ReadProcessMemory', 'int', $osumap[1], 'int', $address[2], 'ptr', $bufferptr, 'int', $buffersize, 'int', '')
$ms = DllStructGetData($buffer,1)
if $ms >= $coords[$j][3][1] Then return 1
if $pixelsptms[1] < 0 Then
if $currcoord[1] <= $coords[$j][1][1] Then
$currcoord[1] = $coords[$j][1][1]
$ready[3] = 1
$pixelsptms[1] = 0
EndIf
Else
if $currcoord[1] >= $coords[$j][1][1] Then
$currcoord[1] = $coords[$j][1][1]
$ready[3] = 1
$pixelsptms[1] = 0
EndIf
EndIf
if $pixelsptms[2] < 0 then
if $currcoord[2] <= $coords[$j][2][1] Then
$currcoord[2] = $coords[$j][2][1]
$ready[4] = 1
$pixelsptms[2] = 0
EndIf
Else
if $currcoord[2] >= $coords[$j][2][1] Then
$currcoord[2] = $coords[$j][2][1]
$ready[4] = 1
$pixelsptms[2] = 0
EndIf
EndIf
if $ready[3] = $ready[4] Then return -1
if $ms >= $firstms Then
$currcoord[1] += $pixelsptms[1]
$currcoord[2] += $pixelsptms[2]
$firstms += 12
mousemove($currcoord[1],$currcoord[2],0)
EndIf
WEnd
EndFunc
'Global Const $ PI = ACos(-1)' – user4157124
非常感謝您的先生。我能夠在你的幫助下實現它的功能。 –
@KevinRazielexŠubrt心智[發表您的解決方案](https://stackoverflow.com/q/47593934/4157124)? – user4157124