Jump to content

How to bind right click to trigger a macro?


Guest Reese Stonecut
 Share

Recommended Posts

Guest Reese Stonecut

Hello...

I wanna make a macro that will do this for me:

Upon my right clicking, it will press key 2, then right click; press key 3, right click again and finally, press key 1 and stand by to my next right click so it will perform the sequence again when I do so...

Problem is: I don´t seem to find a way to bind my right clicking to the rest of the sequence... Can anyone please help me? Here´s the structure of the script:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; variable that comtrols the loop

Dim $isRunning = 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; main function: executes macro when isRunning = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func ExecuteLoop()

Sleep(1000)

Send("!2")

Sleep(500)

MouseClick("right")

Sleep(1000)

send("!3")

Sleep(500)

MouseClick("right")

Sleep(1000)

send("!1")

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; executes function MouseClicked

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func MouseClicked()

MsgBox(64, "debug","mouseclicked executado")

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; turns loop ON

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func InitLoop()

MouseClicked()

if $isRunning = 0 then

$isRunning = 1

endif

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; ends loop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func EndLoop()

$isRunning = 0

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; configures ON and OFF hotkeys

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

HotKeySet("{F9}", "InitLoop")

HotKeySet("{F10}", "EndLoop")

While 1

WEnd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Thanks in advance I hope someone here can help me!

Edited by Reese Stonecut
Link to comment
Share on other sites

Guest Reese Stonecut

Thanks, I´m gonna check it right now...

I´ll edit here with the results ^^

EDIT

MAN, it works... I love you... And the creator of that thing ^^ :)

Edited by Reese Stonecut
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...