ControlClick some times "Click" where mouse are

Get help with using AutoHotkey and its commands and hotkeys
scriptors
Posts: 144
Joined: 25 Feb 2016, 09:01

ControlClick some times "Click" where mouse are

Post by scriptors » 21 Sep 2018, 08:04

Hi, I don't know if it's one bug or not, but write here my "problem" for possible solution

I use Win10 and AutohotKey_H

I have made one script with many ControlClick ... but, random, I have some "mouseclick" where mouse are on, so I need to move mouse in portion of screen were no interaction are possible.

Try to use SetControlDelay -1 (but have problem) and change with SetControlDelay 10 ... for try ... but have same problem

this just for example (here no problem but i have identic script with ControlClick), but I have same problem olso with other type of script:

Code: Select all

!^z::
Loop
{
PixelGetColor, Res, 435, 160, RGB ; Colore sfondo fine pacchetti
	if(Res = 0x384A59 or Res = 0x394B58 
	or Res = 0x3F4D5D or Res = 0x3F4D5D){ ; checks 
	Sleep 2000
	break  ; Terminate the loop
}
				Sleep 500
MouseClick, left, 439, 340
Sleep 100
MouseClick, left, 439, 289
Sleep 100
MouseClick, left, 439, 241
Sleep 100
MouseClick, left, 439, 190
Sleep 100
MouseClick, left, 439, 139
Sleep 300
MouseClick, left, 439, 95
Sleep 100
	}
Return
here other script (but of course are for hotkey_h)

Code: Select all

^!t::
; first coords serie
1:=MyClickLoop(470,167,0x3C4B58,"1")
Alex:=MyClickLoop(470, 167, 0x3C4B58, "Alex")
; second coords serie
Buldrain:=MyClickLoop(348, 130, 0x3D4C59, "Buldrain")
miniLuigi:=MyClickLoop(348, 130, 0x3D4C59, "miniLuigi")
Empy:=MyClickLoop(348, 130, 0x3D4C59, "Empy")
Return

MyClickLoop(xClick, yClick, color, wname) ;xClick,yClick = window click / color = color to find / wname = window name
; variable send from caller must write: " var " note the space ;)
	{
	return AhkThread("
	(
	CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread
	WinGetPos, X, Y, , , " wname "
	xPixel := X + " xClick " ;screen coords X for chek
	yPixel := Y + " yClick " ;screen coords Y for chek
	Loop
	{
		PixelGetColor, Res, %xPixel%, %yPixel%, RGB ; Note variable are calculated internally so %var%
			if(Res = " color " or Res = " color "){ ; checks if GIFT PACK are finish
			Sleep 2000
			break  ; Terminate the loop
			}
	Sleep 500
	ControlClick, x" xClick " y" yClick ", " wname ",,,, NA
	}
)")
}

Return to “Ask For Help”