 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ecksphore
Joined: 21 Nov 2006 Posts: 48
|
Posted: Sat Aug 23, 2008 2:34 am Post subject: Expressions in PixelSearch? Help! |
|
|
| Code: |
PixelSearch, X, Y, X1, Y1, X2, Y2, (0xFFFFFF OR 0xF9B644), , Fast
|
That doesn't work. Could someone show me the proper way to do it? |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 464 Location: Canada
|
Posted: Sat Aug 23, 2008 3:04 am Post subject: |
|
|
Try Pixel Search with an OffSet. _________________
Xfire: SpiderGames77 |
|
| Back to top |
|
 |
ecksphore
Joined: 21 Nov 2006 Posts: 48
|
Posted: Sat Aug 23, 2008 3:18 am Post subject: |
|
|
| How would I do that? |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 464 Location: Canada
|
Posted: Sat Aug 23, 2008 3:21 am Post subject: |
|
|
Quoted from help menu....
| Quote: |
PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID [, Variation, Fast|RGB]
|
| Quote: |
Variation.
A number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of the color (can be an expression). This parameter is helpful if the color sought is not always exactly the same shade. If you specify 255 shades of variation, all colors will match. The default is 0 shades. | [/quote] _________________
Xfire: SpiderGames77 |
|
| Back to top |
|
 |
ecksphore
Joined: 21 Nov 2006 Posts: 48
|
Posted: Sat Aug 23, 2008 3:44 am Post subject: |
|
|
There is no way that will work for this case. The colors I'm looking for are very specific and if I used the variation method, it'll find matches it shouldn't.
| Quote: |
ColorID The decimal or hexadecimal color ID to search for, in Blue-Green-Red (BGR) format, which can be an expression.
|
Anyone know how to do it via expression? |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1496
|
Posted: Sat Aug 23, 2008 5:10 am Post subject: Re: Expressions in PixelSearch? Help! |
|
|
| ecksphore wrote: | | Code: |
PixelSearch, X, Y, X1, Y1, X2, Y2, (0xFFFFFF OR 0xF9B644), , Fast
|
That doesn't work. Could someone show me the proper way to do it?...
...Anyone know how to do it via expression? |
Expressions resolve to one, and only one, result each time they are evaluated. To PixelSearch for two colors, you need two lines of pixelsearch, i.e. | Code: | PixelSearch, X, Y, X1, Y1, X2, Y2, 0xFFFFFF, 0, Fast
result := !ErrorLevel
PixelSearch, X, Y, X1, Y1, X2, Y2, 0xF9B644, 0, Fast
If !ErrorLevel || result
msgbox, One or both colors were found
else
msgbox, Neither color was found. |
p.s. I found one of my mistakes in a bit of code I posted in one of your other topics. _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
ecksphore
Joined: 21 Nov 2006 Posts: 48
|
Posted: Sat Aug 23, 2008 5:35 am Post subject: |
|
|
Ah, well that sucks.
Thanks again for your assistance!
P.S. I was able to modify your other code a bit and it works great  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|