Jump to content

About A Small Pixelsearch


Recommended Posts

Help file infor for PixelSearch

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

Failure: Sets @error to 1 if color is not found.

You need to check @error first, what if the pixel isnt found, then coord will not be an array

$Delay = 100
$MouseSpeed = 0

$coord = PixelSearch( 0, 100, 800, 475, 0x6aad54, 20, 5 )

If @error = 1 Then
         MsgBox( 0, "ERROR!!!", "The pixel 0x6aad54 was not found" )
Else
         MouseClick("left",$coord[0],$coord[1], 1, $MouseSpeed)
EndIf

Sleep($Delay)

EXIT

that should prevent u from getting that error, will only try to use coord if the pixel was found

EDIT: typo in post

Edited by Don N

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

1

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

Failure: Sets @error to 1 if color is not found.

2

Dim $coord
$Delay = 100
$MouseSpeed = 0

$coord = PixelSearch( 0, 100, 800, 475, 0x6aad54, 20, 5 )
if Not @error Then MouseClick("left",$coord[0],$coord[1], 1, $MouseSpeed)
Sleep($Delay)

oooo... same response... but way slow..lol

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Help file infor for PixelSearch

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

Failure: Sets @error to 1 if color is not found.

You need to check @error first, what if the pixel isnt found, then coord will not be an array

$Delay = 100

$MouseSpeed = 0

$coord = PixelSearch( 0, 100, 800, 475, 0x6aad54, 20, 5 )

If @error = -1 Then

MsgBox( 0, "ERROR!!!", "The pixel 0x6aad54 was not found" )

Else

MouseClick("left",$coord[0],$coord[1], 1, $MouseSpeed)

EndIf

Sleep($Delay)

EXIT

that should prevent u from getting that error, will only try to use coord if the pixel was found

EDIT: typo in post

???

8)

Edited by Valuater

NEWHeader1.png

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