Page 2 of 2 FirstFirst
1
2
  1. #21
    OK so here is another script:
    TIMEOUT = 1500

    function OnEvent(event, arg, family)
    if event == "MOUSE_BUTTON_PRESSED" and arg == 9 then
    if GetRunningTime() - (timestamp or 0) >= TIMEOUT then index = 0 end
    index = (index or 0) + 1
    if index > 2 then index = 1 end
    if index == 1 then
    PressKey("e")
    elseif index == 2 then
    PressMouseButton(1)
    end
    timestamp = GetRunningTime()
    elseif event == "MOUSE_BUTTON_RELEASED" and arg == 9 then
    if index == 1 then
    ReleaseKey("e")
    elseif index == 2 then
    ReleaseMouseButton(1)
    end
    end
    end

    What this does is this:
    On the first click it clicks "E".
    On the second click it clicks the left mouse button.
    And if you dont click it a second time for 1,5 s it jumps back to the beginning of the script so if you are spamming it it wont leave it at the 2nd stage of the script.
    There is no timing between hardware events so each click is like a click you would do on a keyboard or mouse unlike the previous script which uses the mouses top response speed so each click lasted 2-3ms which is impossible for a human but witch this script each click last just as long as a real click would on you keyboard or mouse.
    Many THX to kgober on the logitech forums.
    Last edited by ilkay; 2014-05-27 at 10:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •