: Fix script to pause macro when mouse bottom is pressed

Get help with using AutoHotkey and its commands and hotkeys
jamarchesan
Posts: 4
Joined: 14 Jul 2018, 07:57

: Fix script to pause macro when mouse bottom is pressed

14 Jul 2018, 08:16

: Hi,
I need help to fix a macro.
I’m playing a game that I need to cast a skill in bottom “W” (some times) before fight. So, I created a macro that cast/ press W – infinitely.
But, I need to add a command that if I press any mouse bottom, this macro will pause automatically and back to work if any mouse bottom are not pressed.
Original macro:
o:: Loop,
{
Send W
Sleep 400
}
Loop
{
p::exitapp
jamarchesan
Posts: 4
Joined: 14 Jul 2018, 07:57

Re: : Fix script to pause macro when mouse bottom is pressed

14 Jul 2018, 08:35

jamarchesan wrote:: Hi,
I need help to fix a macro.
I’m playing a game that I need to cast a skill in bottom “W” (some times) before fight. So, I created a macro that cast/ press W – infinitely.
But, I need to add a command that if I press any mouse bottom, this macro will pause automatically and back to work if any mouse bottom are not pressed.
Original macro:
o:: Loop,
{
Send W
Sleep 400
}
Loop
{
p::exitapp
Because I do it several time per minute - I don't wanna need press other bottom to pause it. The pause in mouse bottom is the best
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: : Fix script to pause macro when mouse bottom is pressed

14 Jul 2018, 11:49

Code: Select all

o:: 
Loop
{ 
	if(GetKeyState("LButton", "p") or GetKeyState("MButton", "p") or GetKeyState("RButton", "p"))
	{
		Sleep, 50
		continue
	}
	Send W 
	Sleep 400 
} 

p::exitapp

Return to “Ask For Help”

Who is online

Users browsing this forum: asad41163, Bing [Bot], Timmy347 and 222 guests