【发布时间】:2015-12-19 07:31:41
【问题描述】:
使用PixelSearch() 和相对的鼠标移动,我让这个脚本将鼠标光标锁定在一个颜色上:
While 1
$pos = MouseGetPos()
$coord = PixelSearch($pos[0]+80, $pos[1]+80, $pos[0]-80, $pos[1]-80, $color, 10,5)
If IsArray($coord) = 1 Then
Local $iX = $pos[0], $iY = $pos[1]
If ($iX < $coord[0]) Then _MouseMoveRelative(1, 0);$iStepSize
If ($iX > $coord[0]) Then _MouseMoveRelative(-1, 0);$iStepSize
If ($iY < $coord[1]) Then _MouseMoveRelative(0, 1);$iStepSize
If ($iY > $coord[1]) Then _MouseMoveRelatsdive(0, -1);$iStepSize
GUISetState()
EndIf
WEnd
如果我增加步数,它会更快,但它会偏离目标。如果我减少,它会更慢但更准确。如何使这尽可能快?
【问题讨论】:
标签: autoit