如何检查变量的整数值是否正在增加?
How to check if an integer value of a variable is increasing?
如何检查变量的整数值是否在增加?
例如,如果 positionX 的值增加,则它会减少该值
使用一个变量来存储最后一个鼠标坐标。
然后每次检查鼠标坐标时,将其与上一个值进行比较,然后更新上一个值。
类似
local lastCoord
local coord = GetMouseCoord()
if lastCoord and coord.x > lastCoord.x then
print("x increased")
end
lastCoord = coord
如何检查变量的整数值是否在增加?
例如,如果 positionX 的值增加,则它会减少该值
使用一个变量来存储最后一个鼠标坐标。
然后每次检查鼠标坐标时,将其与上一个值进行比较,然后更新上一个值。
类似
local lastCoord
local coord = GetMouseCoord()
if lastCoord and coord.x > lastCoord.x then
print("x increased")
end
lastCoord = coord