Jump to content

Pixel Help


Recommended Posts

Well, how can i Get it in a very small area.. Like Half the size of a letter Like i am typing? Or smaller

<{POST_SNAPBACK}>

Below is a quote from the help file.

Searches a rectangle of pixels for the pixel color provided.

PixelSearch ( left, top, right, bottom, color [, shade-variation][, step]] )

Parameters

left coordinate of rectangle.

top coordinate of rectangle.

right coordinate of rectangle.

bottom coordinate of rectangle.

Colour value of pixel to find (in decimal or hex).

[optional] A number between 0 and 255 to indicate the allowed number of shades of variation of the red, green, and blue components of the colour. Default is 0 (exact match).

[optional] Instead of searching each pixel use a value larger than 1 to skip pixels (for speed). E.g. A value of 2 will only check every other pixel. Default is 1.

Something you may want to consider instead of PixelSearch() for speed is PixelGetColor(). Below is the helpfile quote.

Returns a pixel color according to x,y pixel coordinates.

PixelGetColor ( x , y )

Parameters

x coordinate of pixel.

y coordinate of pixel.

You can use the above as follows.

Dim $x, $y
$x = 123
$y = 321
While 1
    If PixelGetColor($x, $y) =  16777215 Then
        If PixelGetColor($x + 3, $y + 3) = 16120317 Then;Double check
            _DoSomething()
        EndIf
    EndIf
    Sleep(100);slows lag
WEnd

Func _DoSomething()
    Local $x, $y
    $x = 345
    $y = 543

    MouseClick("left", $x, $y, 1, 0);moves mouse instantly and clicks.
EndFunc

I hope the above code sample helped. All that I wrote from reading the helpfile.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Js, really didnt understand that, i am still very new to autoit, mind explaining more?

<{POST_SNAPBACK}>

Since that was such a large reply.. could you explain a bit more what you dont understand? Tell me what you think it means and I will tell you whether or not you are right and what it means as I said it.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I dont understand alot of it like.

Dim $x, $y

what the heck is that?

<{POST_SNAPBACK}>

Oh boy.

To create a variable it is always best to declare first by using the Dim keyword. Look up variables in the helpfile. It explains it.

Have you ever scripted anything or programmed at all?

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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