Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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]

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
×
×
  • Create New...