local ffi = require("ffi")
ffi.cdef[[
bool SetCursorPos(int X, int Y);
]]
function lerp(start, goal, t)
return start + (goal - start) * t
end
function main()
local startTime = os.clock()
local startX, startY = 100, 100
local goalX, goalY = 500, 500
local duration = 2
while true do
wait(0)
local elapsed = os.clock() - startTime
local t = elapsed / duration
if t >= 1 then break end
ffi.C.SetCursorPos(lerp(startX, goalX, t), lerp(startY, goalY, t))
end
end