I assume you are using GHUB (but the same could be done in LGS).
Step 0.
You are about to modify the behavior of Left Mouse Button.
This is a potentially dangerous operation: you can do nothing on your computer without LMB.
So you must create a "spare LMB".
For example, if you don't use Mouse Button 8, you can make it acting like a clone on LMB.
Go to GHUB (mouse device, "Assignments" screen, SYSTEM tab).
Bind "Primary click" to your physical MB#8.
Now, if something goes wrong and your LMB stops working, you can press MB#8 instead of LMB.
It might happen that you don't want to expend a mouse button for "spare LMB" because all the mouse buttons are in use for something important.
If you have a Logitech keyboard you can use one of its G-buttons as "spare LMB" (keyboard device, "Assignments" screen, SYSTEM tab).
Step 1.
Do you use Mouse Button 4 ("back") in the game?
- If YES (some action is assigned to MB#4 in the game), proceed to "Step 2".
- If NO (the game ignores MB#4 press), skip "Step 2" and proceed to "Step 3".
Step 2.
You have to remap game action from MB#4 to some other key.
Do the following:
- choose keyboard button you don't currently use in the game
(let's assume the F12
key is not currently used)
- go to GHUB (mouse device, "Assignments" screen, KEYS tab);
bind F12
to your physical MB#4
- go to game options;
assign the game action to F12
instead of MB#4
Now when you press physical MB#4, the game receives F12
and activates the game action.
Skip "Step 3" and proceed to "Step 4".
Step 3.
Go to GHUB (mouse device, "Assignments" screen).
Unbind "Back" from physical MB#4 (click and select DISABLE from the drop-down menu).
Disabled MB#4 will look like a white circle with black inside.
Step 4.
Set the script (see below).
Step 5.
Go to GHUB (mouse device, "Assignments" screen, SYSTEM tab).
Bind "Back" to your physical LMB.
You will see a warning about a potentially dangerous operation.
Allow this operation because you have the "spare LMB".
--Button used to turn rapid fire on/off
local rfLock = "scrolllock"
--Rapid fire values used in randomization/realism, in ms (milleseconds).
local rfLo = 45
local rfHi = 75
function OnEvent(event, arg)
if event == "PROFILE_ACTIVATED" then
EnablePrimaryMouseButtonEvents(true)
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
PressMouseButton(1)
if IsKeyLockOn(rfLock) then
repeat
Sleep(math.random(rfLo,rfHi))
if not IsMouseButtonPressed(4) then break end
ReleaseMouseButton(1)
Sleep(math.random(rfLo,rfHi))
PressMouseButton(1)
until not IsMouseButtonPressed(4) -- 4 = "Back"
end
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
ReleaseMouseButton(1)
end
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…