Jump to content

Don't understand pixel searcg


Recommended Posts

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

Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...