我正在尝试在 LUA (GHUB) 中创建一个本地函数,将鼠标移动到屏幕上的特定坐标。 然而,指针在函数调用结束时突然移动......甚至没有到达正确的位置。 另外..无论如何我可以在GHUB中调试LUA...据我所知几乎是不可能的。甚至没有语法错误。
谢谢!
local function MouseMoveToSlower(x, y, speed)
current_x, current_y = GetMousePosition()
distance = math.sqrt((x - current_x)^2 + (y - current_y)^2)
steps = math.floor(distance / speed)
for i = 1, steps do
new_x = current_x + (x - current_x) * i / steps
new_y = current_y + (y - current_y) * i / steps
MoveMouseRelative(new_x - current_x, new_y - current_y)
Sleep(math.random(102,125))
end
end
MoveMouseRelative
期望距离以 1 pixel
为单位(屏幕宽度 = 1920 单位)GetMousePosition
返回以 (screen_size)/64K
为单位的距离(屏幕宽度 = 65536 单位)