罗技⿏标宏-压lua脚本
local fireStatus = false --设置⼀个全局变量,控制是否启⽤该功能
--SetBacklightColor(0,0,255) --设置背光, 我的设备不⽀持,就注释掉了
function OnEvent(event, arg) --全部事件的监控
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4 ) then --⽤4键来开启此功能
fireStatus = not fireStatus
--if(fireStatus) then
--SetBacklightColor(255,0,0)
--else
--SetBacklightColor(0,0,255)
-
-end
end
if ( fireStatus == true and event == "MOUSE_BUTTON_PRESSED" and arg == 1 ) then --检测到⿏标左键按下
--while(IsMouseButtonPressed(1)) -- 当⿏标左键处于按下状态时执⾏下⾯代码 (不知什么原因,循环语句在我的游戏窗⼝上不起作⽤,就没有⽤循环控制) --do
MoveMouseRelative(0, 4) --⿏标指针相对位移
Sleep(80) --睡眠 (⽤循环做时睡眠函数不可去掉,否则代码执⾏过快,容易卡死,相当于死循环)
MoveMouseRelative(0, 4)
记住我Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
MoveMouseRelative(0, 4)
Sleep(80)
--MoveMouseRelative(0, 50)
--end
end
end
发布评论