求一个lua的语句
EnablePrimaryMouseButtonEvents(true)functionOnEvent(event,arg)if(event=="MOUSE_BUTTON...
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
while (true)
do
if (IsMouseButtonPressed(1)) then
ReleaseMouseButton(1)
MoveMouseRelative(0,12)
PressMouseButton(1)
Sleep(30)
else
break
end
end
end
end
我想让 MoveMouseRelative(0,12)这个12的数字变成在9到14范围内随机变化。求大神帮写个代码 展开
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
while (true)
do
if (IsMouseButtonPressed(1)) then
ReleaseMouseButton(1)
MoveMouseRelative(0,12)
PressMouseButton(1)
Sleep(30)
else
break
end
end
end
end
我想让 MoveMouseRelative(0,12)这个12的数字变成在9到14范围内随机变化。求大神帮写个代码 展开
1个回答
展开全部
EnablePrimaryMouseButtonEvents(true)
math.randomseed(tostring(os.time()):reverse():sub(1, 6))
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
while (true)
do
if (IsMouseButtonPressed(1)) then
ReleaseMouseButton(1)
MoveMouseRelative(0,math.random(9,14))
PressMouseButton(1)
Sleep(30)
else
break
end
end
end
end
采纳吧
math.randomseed(tostring(os.time()):reverse():sub(1, 6))
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
while (true)
do
if (IsMouseButtonPressed(1)) then
ReleaseMouseButton(1)
MoveMouseRelative(0,math.random(9,14))
PressMouseButton(1)
Sleep(30)
else
break
end
end
end
end
采纳吧
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询