-------------------------------------------------------------------------------------------------------注释
---------------------------
-- DIP:1200 开--
-- 垂直灵敏度倍数2.0 发--
-- 单倍镜灵敏度48 参--
-- 二倍镜灵敏度55 数--
---------------------------
--基本功能介绍:
--按下右键后一秒内按下左键辅助下拉屏幕
--按下键盘左侧Alt再按鼠标右键开启
--按住左Shift降低下拉幅度至1/2,松开恢复
--按下鼠标中键切换模式(屏幕向上低向下高)
--注意事项:
--因为使用dip按键切换模式和开关,所以dip的按键的切换dip功能需要禁用(不禁用不知道会不会有影响),不会禁用自行百度
--若感觉下压幅度过低,修改isShift()函数中return的值即可,第一个值为下蹲后下拉幅度,第二个值为常规下拉灵敏度
--若只需要微调,修改switchMode()函数中time的值
--同理调整不同模式下压幅度的方式也是修改switchMode()函数中time的值
--time的值意思是每多少毫秒进行一次下拉
--return返回的值的意思是每次下拉屏幕多上个像素
--time和return的值都必须为整数
-------------------------------------------------------------------------------------------------------正文
--开启鼠标监听
EnablePrimaryMouseButtonEvents(true);
--open用于开关辅助下压的判断
open = false
--right用于获取开镜时间,left用于获取开火时间,timeDiff用于计算二者差值
right = nil
left = nil
timeDiff = nil
--time用于操作屏幕下拉间隔的Sleep
time = 2
--mode用于切换高/低模式
mode =false
---------------------------------------------------------------------------------开关
function isOpen(event,arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6 ) then
switchMode()
if IsModifierPressed("lalt") then
open = not open
if open then
OutputLogMessage("开启\n")
else
OutputLogMessage("关闭\n")
end
end
end
return open
end
---------------------------------------------------------------------------------模式切换
function switchMode()
if not IsModifierPressed("lalt") and open then
mode = not mode
if mode then
time=15
MoveMouseRelative(0,-10)
OutputLogMessage("低下压幅度模式\n")
else
time=2
MoveMouseRelative(0,10)
OutputLogMessage("高下压幅度模式\n")
end
end
end
---------------------------------------------------------------------------------开镜一秒内是否开火
function isFire(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 2) then
right = tonumber(GetDate('%S'))
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and right ~= nil) then
left = tonumber(GetDate('%S'))
timeDiff = math.abs(left - right)
right = nil
left = nil
end
if timeDiff <= 1 or timeDiff >= 59 then
return true
else
return false
end
end
---------------------------------------------------------------------------------判断是否按下蹲
function isShift()
if IsModifierPressed("lshift") then
return 1
else
return 2
end
end
---------------------------------------------------------------------------------下压
function down()
Sleep(10)
repeat
MoveMouseRelative(0,isShift())
Sleep(time)
until not IsMouseButtonPressed(1)
timeDiff = nil
end
---------------------------------------------------------------------------------程序主体
function OnEvent(event, arg)
isOpen(event,arg)
if open then
if isFire(event, arg) then
down()
end
end
end




---------------------------
-- DIP:1200 开--
-- 垂直灵敏度倍数2.0 发--
-- 单倍镜灵敏度48 参--
-- 二倍镜灵敏度55 数--
---------------------------
--基本功能介绍:
--按下右键后一秒内按下左键辅助下拉屏幕
--按下键盘左侧Alt再按鼠标右键开启
--按住左Shift降低下拉幅度至1/2,松开恢复
--按下鼠标中键切换模式(屏幕向上低向下高)
--注意事项:
--因为使用dip按键切换模式和开关,所以dip的按键的切换dip功能需要禁用(不禁用不知道会不会有影响),不会禁用自行百度
--若感觉下压幅度过低,修改isShift()函数中return的值即可,第一个值为下蹲后下拉幅度,第二个值为常规下拉灵敏度
--若只需要微调,修改switchMode()函数中time的值
--同理调整不同模式下压幅度的方式也是修改switchMode()函数中time的值
--time的值意思是每多少毫秒进行一次下拉
--return返回的值的意思是每次下拉屏幕多上个像素
--time和return的值都必须为整数
-------------------------------------------------------------------------------------------------------正文
--开启鼠标监听
EnablePrimaryMouseButtonEvents(true);
--open用于开关辅助下压的判断
open = false
--right用于获取开镜时间,left用于获取开火时间,timeDiff用于计算二者差值
right = nil
left = nil
timeDiff = nil
--time用于操作屏幕下拉间隔的Sleep
time = 2
--mode用于切换高/低模式
mode =false
---------------------------------------------------------------------------------开关
function isOpen(event,arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6 ) then
switchMode()
if IsModifierPressed("lalt") then
open = not open
if open then
OutputLogMessage("开启\n")
else
OutputLogMessage("关闭\n")
end
end
end
return open
end
---------------------------------------------------------------------------------模式切换
function switchMode()
if not IsModifierPressed("lalt") and open then
mode = not mode
if mode then
time=15
MoveMouseRelative(0,-10)
OutputLogMessage("低下压幅度模式\n")
else
time=2
MoveMouseRelative(0,10)
OutputLogMessage("高下压幅度模式\n")
end
end
end
---------------------------------------------------------------------------------开镜一秒内是否开火
function isFire(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 2) then
right = tonumber(GetDate('%S'))
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and right ~= nil) then
left = tonumber(GetDate('%S'))
timeDiff = math.abs(left - right)
right = nil
left = nil
end
if timeDiff <= 1 or timeDiff >= 59 then
return true
else
return false
end
end
---------------------------------------------------------------------------------判断是否按下蹲
function isShift()
if IsModifierPressed("lshift") then
return 1
else
return 2
end
end
---------------------------------------------------------------------------------下压
function down()
Sleep(10)
repeat
MoveMouseRelative(0,isShift())
Sleep(time)
until not IsMouseButtonPressed(1)
timeDiff = nil
end
---------------------------------------------------------------------------------程序主体
function OnEvent(event, arg)
isOpen(event,arg)
if open then
if isFire(event, arg) then
down()
end
end
end



