Click pixelsearch help
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Click pixelsearch help
Hello, im wondering if any you guys can help me, im looking for help on pixelsearch im wanting to set search area where it would click any colour that pops up that isnt 0x21242E & 0x4EE6EB , i cant give the colours that i want it to click as its random every time i load, thanks if you can help.
Re: Click pixelsearch help
Code: Select all
y := x := 100
PixelGetColor, color, x, y, RGB
If color not in 0x21242E,0x4EE6EB
MouseClick,, x, y
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Thank you, i think its clicking those colours tho not sure if its because im doing the search area wrong, y := x := 776,244,885,914 , for x1,y1,x2,y2, will this script run until a colour is found once found it will stop until i start again, sorry im still trying to learn, thanks for help again.mikeyww wrote: ↑10 Oct 2021, 20:26Code: Select all
y := x := 100 PixelGetColor, color, x, y, RGB If color not in 0x21242E,0x4EE6EB MouseClick,, x, y
Re: Click pixelsearch help
Try:
Code: Select all
x1 := 776, y1 := 244, x2 := 885, y2 := 914
F3:: ; Pressing F3 triggers the subroutine
Loop, % x2 - x1 + 1 {
x := x1 + A_Index - 1
Loop, % y2 - y1 + 1 {
y := y1 + A_Index - 1
PixelGetColor, color, x, y, RGB
ToolTip, (%x%`,%y%) = %color%
If color not in 0x21242E,0x4EE6EB
{ MouseClick,, x, y
SoundBeep, 1000
Return
}
}
}
Return
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Thank you so much this worked, sorry to be a pain, is it possible to make it scan and detect instantly in the box i create with the x and y, reason i would like to make it instant if colour on screen the colour might be gone by time the recent one you made finds it, again thank you so much for taking time to help memikeyww wrote: ↑11 Oct 2021, 07:21Try:
Code: Select all
x1 := 776, y1 := 244, x2 := 885, y2 := 914 F3:: ; Pressing F3 triggers the subroutine Loop, % x2 - x1 + 1 { x := x1 + A_Index - 1 Loop, % y2 - y1 + 1 { y := y1 + A_Index - 1 PixelGetColor, color, x, y, RGB ToolTip, (%x%`,%y%) = %color% If color not in 0x21242E,0x4EE6EB { MouseClick,, x, y SoundBeep, 1000 Return } } } Return
Re: Click pixelsearch help
I believe that your question is how to increase the speed. There might be some other earlier posts about that, along with examples of scripts that use different techniques for the pixel searches. You could search the forum for them. I have lost track of those older posts. You might include the term "Gdip" in your search.
If you are searching for a specific color or a specific range of hues, you can use PixelSearch.
If you are searching for a specific color or a specific range of hues, you can use PixelSearch.
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Thank you again mikey for helping me alot, thanks for the info!mikeyww wrote: ↑11 Oct 2021, 08:32I believe that your question is how to increase the speed. There might be some other earlier posts about that, along with examples of scripts that use different techniques for the pixel searches. You could search the forum for them. I have lost track of those older posts. You might include the term "Gdip" in your search.
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Im just going to use the same x1 and x2 but different y1 and y2 so its in a straight line, just looking to speed up lets say when it start scanning 100-500 i would like it to be instant if possible, i will have a look at the stuff you recommendedmikeyww wrote: ↑11 Oct 2021, 08:32I believe that your question is how to increase the speed. There might be some other earlier posts about that, along with examples of scripts that use different techniques for the pixel searches. You could search the forum for them. I have lost track of those older posts. You might include the term "Gdip" in your search.
If you are searching for a specific color or a specific range of hues, you can use PixelSearch.
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Having no luck here improving speed
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Hello again mikey, sorry for being a best,how would i add multiple y co ords as im going to use the same x, i dont want to use the other method x1 y1 x2 y2, thanks again if you can help me and sorry for being a pest again.mikeyww wrote: ↑10 Oct 2021, 20:26Code: Select all
y := x := 100 PixelGetColor, color, x, y, RGB If color not in 0x21242E,0x4EE6EB MouseClick,, x, y
Re: Click pixelsearch help
Code: Select all
x = 100
For each, y in [100, 200, 300] {
PixelGetColor, color, x, y, RGB
If color not in 0x21242E,0x4EE6EB
MouseClick,, x, y
}
-
- Posts: 12
- Joined: 10 Oct 2021, 16:19
Re: Click pixelsearch help
Hello again, it seems to be only searching the the last input number, for example , if there is a color in 100 and 200 but not 300 it wont click 100 or 200mikeyww wrote: ↑19 Oct 2021, 20:00Code: Select all
x = 100 For each, y in [100, 200, 300] { PixelGetColor, color, x, y, RGB If color not in 0x21242E,0x4EE6EB MouseClick,, x, y }
Re: Click pixelsearch help
There is no need to guess. Inside the loop, you can add lines that display the color values as well as the results of the conditional statement. That will help you to pinpoint the issue.