G502 Script Auto Left Click & Auto Run.
I need a hand making these two scripts work together. Currently only the bottom script will work. I am trying to merge two scripts together. I can only get the bottom script to work atm. I am close but unsure how to get they both to work.
https://github.com/RavenBHK/DBD-Left...55551bbd143dc0
https://github.com/RavenBHK/DBD-Left...55551bbd143dc0
Code:
enabled="false";
function OnEvent(event, arg)
--OutputLogMessage("event = %s, arg = %s\n", event, arg);
if event=="MOUSE_BUTTON_RELEASED" and arg==6 then
--OutputLogMessage("mouse button 4 pressed " .. enabled .. "\n");
if enabled=="true" then
enabled="false";
ReleaseKey("lshift");
ReleaseKey("w");
else
enabled="true";
PressKey("lshift");
PressKey("w");
end
end
if arg=="w" then
if enabled=="true" then
enabled="false";
ReleaseKey("lshift");
ReleaseKey("w");
end
end
toggle_button = 7 -- What mouse button should control the toggle
button_to_toggle = 1 -- What button to toggle
button_toggled = false
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == toggle_button then
button_toggled = not button_toggled
OutputLogMessage("Mouse %d toggled %s", button_to_toggle, tostring(button_toggled))
if button_toggled then
PressMouseButton(button_to_toggle)
else
ReleaseMouseButton(button_to_toggle)
end
end
end