羅技lua之a(chǎn)pex的1抖槍
首先是做了一個關(guān)于對APEX游戲的一個簡易抖槍宏,抖動幅度可以自己調(diào)整
代碼的邏輯是,當(dāng)鼠標(biāo)的右鍵按鍵被按下時,切換開關(guān)狀態(tài),并輸出開關(guān)狀態(tài)。最前提條件是只有在Caps Lock鍵開啟的情況下,鼠標(biāo)右鍵按下,且鼠標(biāo)左鍵按下且開關(guān)狀態(tài)為1時,會執(zhí)行一段鼠標(biāo)移動的代碼,重復(fù)執(zhí)行直到鼠標(biāo)左鍵松開。

local switch = 1
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
? ? OutputLogMessage("Event: " .. event .. " Arg: " .. arg .. "\n")
? ? if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
? ? ? ? switch = 1 - switch??
? ? ? ? OutputLogMessage("Switch state: " .. switch .. "\n")
? ? end
? ? if (IsKeyLockOn("capslock")) then? -- Caps Lock 鍵開啟
? ? ? ? if (IsMouseButtonPressed(3)) then
? ? ? ? ? ? if (arg == 1 and switch == 1) then
? ? ? ? ? ? ? ? repeat
? ? ? ? ? ? ? ? ? ? MoveMouseRelative(-17, 5)--控制xy移動,左右抖動幅度可以調(diào)整,下面同理
? ? ? ? ? ? ? ? ? ? Sleep(1)
? ? ? ? ? ? ? ? ? ? MoveMouseRelative(17, -3)
? ? ? ? ? ? ? ? ? ? Sleep(1)
? ? ? ? ? ? ? ? until not IsMouseButtonPressed(1)
? ? ? ? ? ? end
? ? ? ? end
? ? end
end

還有一個簡易的鼠標(biāo)下壓lua,有時間發(fā)出來