罗技宏压枪脚本
说明:只能减小一点后坐力,不能做到全打到一个点上。有时间再优化下。
鼠标按钮 | 功能 |
---|---|
G6 | 一键关闭宏 |
G4 | 开启 M416 压枪 |
G5 | 开启 M16A4 压枪 |
G7 | 开启 AKM 压枪 |
G8 | 开启 UMP9 压枪 |
推荐把G7、G8调节DPI关闭,使用G模式调节DPI(按住G9+G7、G9+G8),为了开启压枪是不会影响DPI。
脚本代码在下边,使用方法不用说了吧? 有不清楚的在下面评论吧。
--
-- Created by IntelliJ IDEA.
-- User: cactus
-- Date: 2019/1/6
-- Time: 13:45
-- To change this template use File | Settings | File Templates.
--
-- 事件处理方法,点击和释放鼠标时触发。
function OnEvent(event, arg)
-- 启用鼠标按键 1 (左键)的事件报告,(默认关闭)
EnablePrimaryMouseButtonEvents(true)
-- 鼠标按下时, arg对应G1 - Gn
if event == "MOUSE_BUTTON_PRESSED" then
if (arg == 6) then --一键关闭
TransClose();
elseif (arg == 4) then -- M416
TransGun("M416");
elseif (arg == 5) then -- M16A4
TransGun("M16A4");
elseif (arg == 7) then -- AKM
TransGun("AKM");
elseif (arg == 8) then -- UMP9
TransGun("UMP9");
elseif arg == 1 then
if M416 then
Boom("M416");
elseif M16A4 then
Boom("M16A4");
elseif AKM then
Boom("AKM");
elseif UMP9 then
Boom("UMP9");
end
end
end
end
function TransClose()
M416 = false;
M16A4 = false;
AKM = false;
UMP9 = false;
end
function TransGun(name)
CloseTrans();
_G[name] = not _G[name];
end
function Boom(name)
while (IsMouseButtonPressed(1)) do
-- TODO 待优化:根据不同枪械设置数组,而不使用随机数
MoveFunc(function()
if name == "M416" then
return math.random(1, 3), math.random(24, 35), 11 + 50;
elseif name == "M16A4" then
return math.random(0, 2), math.random(20, 35), 1 + 50;
elseif name == "AKM" then
return math.random(0, 2), math.random(24, 41), 15 + 50;
elseif name == "UMP9" then
return math.random(0, 1), math.random(21, 27), 3 + 50;
end
end)
end
end
function MoveFunc(x, y, ms)
MoveMouseRelative(x, y);
Sleep(ms);
end
写在博客是因为罗技吧的吧主把我写的帖子删除了,我看了下贴吧里的帖子大都是需要加群付费获取脚本。