From 0ea62fb8bf4ab0b54af86c753d8c7bcf9a2b1ab5 Mon Sep 17 00:00:00 2001 From: Lin Chengbiao <1072907338@qq.com> Date: Sun, 4 Aug 2019 11:25:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9D=9E=E9=BC=A0=E6=A0=87(?= =?UTF-8?q?=E9=94=AE=E7=9B=98)G=E9=94=AE=E7=BB=91=E5=AE=9A=E9=A2=84?= =?UTF-8?q?=E8=AE=BE=EF=BC=8CF1~12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Soldier76.lua | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/Soldier76.lua b/Soldier76.lua index bb83a3a..e08949a 100644 --- a/Soldier76.lua +++ b/Soldier76.lua @@ -126,8 +126,8 @@ userInfo = { ["ralt + G7"] = "", ["ralt + G8"] = "", ["ralt + G9"] = "", - ["ralt + G10"] = "last_in_canUse", - ["ralt + G11"] = "next_in_canUse", + ["ralt + G10"] = "", + ["ralt + G11"] = "", -- rctrl + G ["rctrl + G3"] = "", ["rctrl + G4"] = "", @@ -148,6 +148,19 @@ userInfo = { ["rshift + G9"] = "", ["rshift + G10"] = "", ["rshift + G11"] = "", + -- 非鼠标G键,可以使键盘或者耳机上的G键,默认使用键盘G键,请确保你使用的是可编程的罗技键盘 | F1~12 (Non-mouse G-key) + ["F1"] = "", + ["F2"] = "", + ["F3"] = "", + ["F4"] = "", + ["F5"] = "", + ["F6"] = "", + ["F7"] = "", + ["F8"] = "", + ["F9"] = "", + ["F10"] = "", + ["F11"] = "", + ["F12"] = "", }, } @@ -960,20 +973,13 @@ function OnEvent (event, arg, family) -- Switching arsenals according to different types of ammunition if event == "MOUSE_BUTTON_PRESSED" and arg >=3 and arg <= 11 and family == "mouse" and pubg.ok then - -- if not pubg.runStatus() and userInfo.startControl ~= "G_bind" then return false end local modifier = "G" - if IsModifierPressed("lalt") then - modifier = "lalt + " .. modifier - elseif IsModifierPressed("lctrl") then - modifier = "lctrl + " .. modifier - elseif IsModifierPressed("lshift") then - modifier = "lshift + " .. modifier - elseif IsModifierPressed("ralt") then - modifier = "ralt + " .. modifier - elseif IsModifierPressed("rctrl") then - modifier = "rctrl + " .. modifier - elseif IsModifierPressed("rshift") then - modifier = "rshift + " .. modifier + local list = { "lalt", "lctrl", "lshift", "ralt", "rctrl", "rshift" } + for i = 1, #list do + if IsModifierPressed(list[i]) then + modifier = list[i] .. " + " .. modifier + break + end end modifier = modifier .. arg -- Get the combination key pubg.renderDom.combo_key = modifier -- Save combination keys @@ -982,6 +988,16 @@ function OnEvent (event, arg, family) pubg.outputLogRender() -- Call log rendering method to output information end + if event == "G_PRESSED" and arg >=1 and arg <= 12 and pubg.ok then + -- if not pubg.runStatus() and userInfo.startControl ~= "G_bind" then return false end + local modifier = "F" + modifier = modifier .. arg -- Get the combination key + pubg.renderDom.combo_key = modifier -- Save combination keys + pubg.renderDom.cmd = userInfo.G_bind[modifier] -- Save instruction name + pubg.runCmd(userInfo.G_bind[modifier]) -- Execution instructions + pubg.outputLogRender() -- Call log rendering method to output information + end + -- Script deactivated event if event == "PROFILE_DEACTIVATED" then ReleaseKey("lshift")