Sign in to follow this  
Followers 0
lasse46

About A Small Pixelsearch

5 posts in this topic

hmmm this code seems right to me?

Dim $coord

$Delay = 100

$MouseSpeed = 0

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

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

Sleep($Delay)

EXIT

but i get :

http://files.upl.silentwhisper.net/upload4/pixelllll.JPG

please would love help?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

???

8)

:"> oooops


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

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  
Followers 0