这是我只能使用整数的脚本,我想知道是否可以修改脚本,以便我可以将浮点数与 MoveMouseRelative 一起使用。
EnablePrimaryMouseButtonEvents (true);
function OnEvent(event,arg)
if IsKeyLockOn("ScrollLock")then
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(0,2)
Sleep(10)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
end
首先,Lua 没有整数。它们的数据类型只是双精度浮点数的数字。请参阅有关数字的Lua文档
你的问题似乎是关于函数
MoveMouseRelative
,这不是关于Lua的问题。我在这里假设这是来自 Logitech G 系列 Lua API,例如可以在here找到其 API 文档。
正如它所说,参数意味着鼠标移动多少像素。显然你不能移动鼠标半像素,那么当给它一个小数作为参数时,你实际上期望它做什么?