lundi 6 novembre 2017

Simple lua Script/macro for mouse

I am really new to programming, I tried looking for answers, but can't find any. Can somebody help me?

I want to create a script where you press a certain mouse button, the button will perform different keys with different timing. For example: I click the right mouse click, the following will be executed:

W-SPACE-SHIFT-W-W

I know how to do this, but how do you turn it into a script where the interval is different each time? Like I press the mouse button then this happens: W - (delay between 0.5 sec and 1 sec) - SPACE (delay between 0.5 sec and 0.7 sec) - SHIFT (delay between 0.3 and 0.35) etc.

I thought this was the start:

EnablePrimaryMouseButtonEvents(true) function OnEvent(event, arg) if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then

keyboard keys will be executed all with a random interval between the keys

end

It's a really simple script, but I don't know how to make it work. Help would be really appreciated.

Good day,

  • Joël



Aucun commentaire:

Enregistrer un commentaire