pickle5 Posted July 28, 2008 Share Posted July 28, 2008 I am trying to understand how to use pixel search but I don't know if im doing it right. Here is some code of what I was doing. If PixelSearch(300, 300, 300, 300, 0xFFFFFF) Then MsgBox(0, "Found", "I found the colour white") Else MsgBox(0, "Not found", "I didn't find the colour white") EndIf It should of found a white pixel on my scripting screen but it didn't find anything. I don't know if this is right so please help if you know how to do it. Thanks. Link to comment Share on other sites More sharing options...
enaiman Posted July 28, 2008 Share Posted July 28, 2008 Try this: PixelSearch(300, 300, 300, 300, 0xFFFFFF) If @error Then MsgBox(0, "Not found", "I didn't find the colour white") MsgBox(0, "Color Found", PixelGetColor(300, 300)) Else MsgBox(0, "Found", "Found the colour white") EndIf If it doesn't find the white color, it will show the message and another one showing you the color found at these coordinates. The Help file is your best friend ... SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
pickle5 Posted July 28, 2008 Author Share Posted July 28, 2008 I think this is what I wanted. Thanks. Link to comment Share on other sites More sharing options...
pickle5 Posted July 28, 2008 Author Share Posted July 28, 2008 How do we do a pixel search inside a certain window? Link to comment Share on other sites More sharing options...
pickle5 Posted July 28, 2008 Author Share Posted July 28, 2008 bump Link to comment Share on other sites More sharing options...
2words4uready Posted July 28, 2008 Share Posted July 28, 2008 bumpbumping that quickly is considered rude Link to comment Share on other sites More sharing options...
pickle5 Posted July 28, 2008 Author Share Posted July 28, 2008 Sorry didn't know. Link to comment Share on other sites More sharing options...
herewasplato Posted July 28, 2008 Share Posted July 28, 2008 How do we do a pixel search inside a certain window?Opt("PixelCoordMode",0) ; 0 = relative coords to the defined window ; 1 = absolute screen coordinates (default) ; 2 = relative coords to the client area of the defined window WinWait("Untitled - Notepad") WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") PixelSearch(300, 300, 300, 300, 0xFFFFFF) If @error Then MsgBox(0, "Not found", "I didn't find the color white") Else MsgBox(0, "Found", "Found the color white") EndIf [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now