Switching Between Buttons Macro?

Get help with using AutoHotkey and its commands and hotkeys
Neon
Posts: 1
Joined: 17 May 2018, 11:48

Switching Between Buttons Macro?

17 May 2018, 12:10

Hi, I'm not really sure how to ask for help here, but I'm not sure how to go about making a macro that's activated on click, rather than after a time frame,

For instance, I press X, and after I press X, after I click once, I want 6 to be pressed, then after I click again, 5 is pressed, then I click again, and 6 is pressed, and repeat that every time I click until I press X again, then it'd stop.

Not sure if that's a proper explanation at all, I've never scripted before and if anyone could make it/point me in the right direction I'd be willing to paypal you like 10$

All help is appreciated, thanks.
User avatar
TLM
Posts: 1238
Joined: 01 Oct 2013, 07:52

Re: Switching Between Buttons Macro?

18 May 2018, 12:10

try

Code: [Select all] [Download] GeSHi © Codebox Plus

x::( arm := !arm ) 							; << x arms/disarms `click` action

#if ( arm ) ; << makes the below mouse hotkey contextual
~lbutton::send % ( ( i := !i ) ? 6 : 5 ) ; << ~ is optional
#if ; << ends above contextual condition
In this example I'm inverting the value of the variables arm and i each time they are referenced.
Image Image Image

Return to “Ask For Help”

Who is online

Users browsing this forum: cattywampus, chef423, llinfeng, Lu3d, mynameisjohn, osuki9x and 30 guests