color triger mouse click

Ask gaming related questions (AHK v1.1 and older)
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

color triger mouse click

05 May 2021, 20:10

im in need of that script
thats search for this color 0x2e282f at a game or entire screen
then left click then wait and repeat until i pause
User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: color triger mouse click

05 May 2021, 21:25

Your description is not codable. Adjust as needed.

Code: Select all

WinGetPos,,, width, height, A
Loop {
 Sleep, 250
 SoundBeep, 1700
 PixelSearch, x, y, 0, 0, width, height, 0x2E282F,, Fast ; Blue, green, red
 If !ErrorLevel
  MouseClick,, x, y
}
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:03

is this cords? PixelSearch, x, y, 0, 0, ?
User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: color triger mouse click

05 May 2021, 22:06

If you click on "PixelSearch" in the posted script, you will see the syntax. "x" and "y" are the output variables.
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:10

im really bad in scripts does i need to add a cord? if i add if only work in that point?
User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: color triger mouse click

05 May 2021, 22:16

If needed, you can change the current coordinates, which are 0, 0, width, height. By default, coordinates are relative to the active window. If needed, you can use CoordMode to change that reference point.

You may wish to consider providing a detailed description of what you need, step by step, with every condition and action, and examples. This could save you the time of many iterations. An alternative could be working with the example that is provided in the documentation.
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:22

i play a game in that game there is spider i have a pixel color get to get those creatures color i just want to keep killing it by left click (atack) just it with sleep option
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:25

i just test its work but only when mouse is at the color point
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:30

i think its need mousemove?
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:35

Code: Select all

CoordMode Mouse
CoordMode Pixel

F1::
	PixelSearch x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xd5071a, 0, Fast RGB
	if (ErrorLevel = 0)
	{
		MouseMove x, y
		MsgBox nd again move to 200 px right and click left mouse button.
		MouseMove 200, 0, , R
		Click
	}
	else if (ErrorLevel = 1)
		MsgBox it was not found,
	else if (ErrorLevel = 2)
		MsgBox there was a problem that prevented the command from conducting the search.
Return
Last edited by gregster on 05 May 2021, 23:05, edited 1 time in total.
Reason: Please use [code] tags. Thank you! (This time, I added them for you.)
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 22:36

i found this one but i think the color its on rgb wont worked :(
vitorcastro
Posts: 47
Joined: 18 Apr 2021, 19:09

Re: color triger mouse click

05 May 2021, 23:08

nvm i think it will bug the game lol
User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: color triger mouse click

06 May 2021, 06:16

It looks like you are on the right track!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 74 guests