Lua 脚本激活键编辑

有人可以帮忙将本地 Macro_Activation_Key 更改为 capslock on = ak47 capslock off = m4a1 吗?这个脚本能加入吗?

这是链接:LUA Script add Delay

感谢您的帮助

点赞
用户1847592
用户1847592

Selection_Key 被移除,现在武器可以通过大写锁定键(Caps Lock)选择

-- 大写锁定键开启 = AK47
-- 大写锁定键关闭 = M4A1
local Macro_Activation_Key = 4    -- 鼠标按键,用于开启/关闭宏

-- d = 移动鼠标之前等待的延迟时间 (默认为9)
local AK47_Pattern = {{x=0,y=2},{d=11,x=0,y=2},{d=12,x=0,y=2},{x=0,y=3},{x=0,y=4},{x=0,y=4},{x=0,y=5},{x=0,y=8},{x=0,y=8},{x=0,y=8}}
local M4A1_Pattern = {{x=0,y=1},{d=5,x=0,y=1},{d=7,x=0,y=2},{x=0,y=2},{x=0,y=1},{x=0,y=1},{x=0,y=2},{x=0,y=2},{x=0,y=3},{x=0,y=3},{x=0,y=3},{x=0,y=3},{x=0,y=3},{x=0,y=3},{x=0,y=3},{x=-1,y=4},{x=-1,y=4},{x=0,y=5},{x=-1,y=5},{x=-1,y=5},{x=0,y=5},{x=0,y=5},{x=0,y=5}}

local function OutputLogs(s)
   OutputLogMessage(s.."\n")
   OutputDebugMessage(s.."\n")
   ClearLCD()
   OutputLCDMessage(s)
end

local Recoil_Activator

function OnEvent(event, arg)
   if event == "PROFILE_ACTIVATED" then
      EnablePrimaryMouseButtonEvents(true)
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == Macro_Activation_Key then
      Recoil_Activator = not Recoil_Activator
      OutputLogs(Recoil_Activator and "ON_Macro" or "OFF_Macro")
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 and Recoil_Activator then
      local pattern = IsKeyLockOn("capslock") and AK47_Pattern or M4A1_Pattern
      for i = 1, #pattern do
         Sleep(pattern[i].d or 9)
         MoveMouseRelative( pattern[i].x, pattern[i].y )
         if not IsMouseButtonPressed(1) then
            break
         end
      end
   end
end
2020-09-10 06:32:31