Jump to content
Sign in to follow this  
pickle5

Don't understand pixel searcg

Recommended Posts

pickle5

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. :P

Share this post


Link to post
Share on other sites
enaiman

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 :)

Share this post


Link to post
Share on other sites
pickle5

I think this is what I wanted.

Thanks.

Share this post


Link to post
Share on other sites
pickle5

How do we do a pixel search inside a certain window?

Share this post


Link to post
Share on other sites
herewasplato

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.