AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Expressions in PixelSearch? Help!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ecksphore



Joined: 21 Nov 2006
Posts: 48

PostPosted: Sat Aug 23, 2008 2:34 am    Post subject: Expressions in PixelSearch? Help! Reply with quote

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
View user's profile Send private message
SpiderGames



Joined: 09 Jun 2008
Posts: 464
Location: Canada

PostPosted: Sat Aug 23, 2008 3:04 am    Post subject: Reply with quote

Try Pixel Search with an OffSet.
_________________

Xfire: SpiderGames77
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ecksphore



Joined: 21 Nov 2006
Posts: 48

PostPosted: Sat Aug 23, 2008 3:18 am    Post subject: Reply with quote

How would I do that?
Back to top
View user's profile Send private message
SpiderGames



Joined: 09 Jun 2008
Posts: 464
Location: Canada

PostPosted: Sat Aug 23, 2008 3:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ecksphore



Joined: 21 Nov 2006
Posts: 48

PostPosted: Sat Aug 23, 2008 3:44 am    Post subject: Reply with quote

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
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Sat Aug 23, 2008 5:10 am    Post subject: Re: Expressions in PixelSearch? Help! Reply with quote

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
View user's profile Send private message
ecksphore



Joined: 21 Nov 2006
Posts: 48

PostPosted: Sat Aug 23, 2008 5:35 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group