Jump to content

pixel question.


Lambort
 Share

Recommended Posts

  • Moderators

What's wrong with this? I selected a color from the "Play Live" button at: http://gunbound.ijji.com/ and want it to press enter on that button so it starts.

-Alyssa

Might want to look at what PixelSearch returns....

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

it returns $pix does it not?

Did you bother to read the help file before you even responded to my question?

Return Value

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

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Did you bother to read the help file before you even responded to my question?

Yeah, I looked at the help file for like the 5th time for the pixelsearch function. I guess I just overlooked that part, I know it has to be something to do with
$pix[0], $pix[1]
but what goes before that to make it work? I can only find mouse movement/click functions that have coordinates.
Link to comment
Share on other sites

  • Moderators

Yeah, I looked at the help file for like the 5th time for the pixelsearch function. I guess I just overlooked that part, I know it has to be something to do with

$pix[0], $pix[1]
but what goes before that to make it work? I can only find mouse movement/click functions that have coordinates.
For the 2nd time

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

I give. that doesn't help me with pixelsearch at all, I'm just going to search the forums through 50+ pages seeking my answer (i've already been through the first 20).

-Alyssa

That's the 2nd time you've said that link I've provided didn't help with your question at hand.

It might not help you specifically for this particular task right away, but it will in fact help. It will teach you the basics of AutoIt and show you what to look for and how to find it. Now you may have read 50 posts, and I believe you, because I've seen you in a few of them. But what good does it do you reading a post, if you don't understand what the code does? That link will teach you what the code does, then you gain a basic understanding and won't have to posts questions like this and risk the chance of getting flammed for something so simple that the help file explains quite well (you just don't understand it).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

ControlSend ( "title", "text", controlID, "string" [, flag] )

you could send a coordinate, but it won't give you anything as it expects a string to be sent not a coordinate.

the pixelsearch() will help you with the mouseclick(), as it can use the coordinates to move to the desired location.

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

  • Moderators

ControlSend ( "title", "text", controlID, "string" [, flag] )

you could send a coordinate, but it won't give you anything as it expects a string to be sent not a coordinate.

the pixelsearch() will help you with the mouseclick(), as it can use the coordinates to move to the desired location.

I've yet to see a post of yours that makes sense.

@Lambort, I'll attempt to explain:

1. PixelSearch() has parameters that must be used in order to search for a color or shade of color.

2. If the color or shade of color is found the return result is an array.

........ Now this is where it steps off ......... Now you must understand an Array and what that is

3. The Array returned is 0 based meaning [0] element = the x coordinate and [1] element = the y coordinate (again, and understanding of arrays helps a tad here).

4. If the color is not found, the return is an @error = 1

post-4813-1161689736_thumb.png

Ok so let's try to learn what the parameters mean.

$xTopLeft = 0;Starting point for search
$yTopLeft = 0;Starting point for search
$xBottomRight = 200;x ending point
$yBottomRight = 120;y ending point
$nColor = 0x000000;Find the Black Color
$iShade = 0;I want to only find pure black
$iStep = 1;I want to search every pixel from start to end

While 1; Loop until we find the color
    $aPix = PixelSearch($xTopLeft, $yTopLeft, $xBottomRight, $yBottomRight, $nColor, $iShade, $iStep)
    If Not @error Then ExitLoop;We found the color now exit the loop that is holding us here
    Sleep(100);Give the CPU a rest
WEnd
MsgBox(64, 'Info', 'If you are here, then the color was found! & @CR & x-coord is: ' & $aPix[0] & @CR & ' and the  y-coord is: ' & $aPix[1])

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I've yet to see a post of yours that makes sense.

Point taken, I'll stop posting about things I don't know about.

Thanks for letting me know, I thought I was helping.

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

  • Moderators

Point taken, I'll stop posting about things I don't know about.

Thanks for letting me know, I thought I was helping.

Didn't say you needed to do that... just thought you were following my lead :whistle:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Damn, you're confusing me :whistle:

I was mostly referring to his earlier problem with pushing a button in a flash window and not neccesarily by using pixelsearch().

I'll let you continue this topic, ie. I'll follow your lead ;)

> there are 10 types of people in the world, those who understand binary and those who don't.

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