Jump to content

Recommended Posts

Posted

Well, i want this script to Find the pixel, and click it.

pretty simple, but i cant get it to work, heres my code so far:

Func TestProgram
$Pixel = PixelSearch(32,309,2,2,0xADDEA4)
   If @error <> 1 Then;if pixel is found...

   Endif
EndFunc

Ok help :P.

Can you add ; to the code for me, So i know what u did :(

Posted (edited)

$Pixel = PixelSearch(32,309,2,2,0xADDEA4);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1
If Not @error Then;if it did find it then
    MouseClick("left", $Pixel[0], $Pixel[1] , 1, 0);move the mouse to it instantly click the left mouse button once
EndIf

Edited by FaT3oYCG

Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

  • Moderators
Posted

Left = Top left "x" position of the rectangle you want to search

Top = Top left "y" position of the rectangle you want to search

Right = Bottom right "x" position of the rectangle you want to search (not really bottom, but you get the picture)

Bottom = Bottom right "y" position of the rectangle you want to search

Left/Top

xy........................................

............................................

............................................

............................................

........................................xy

--------------------Right/Bottom

So you would have two sets of x and y coords (a starting x, a starting y, an ending x and an ending 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.

Posted (edited)

TestProgram()
Func TestProgram()
Send("{LWINDOWN}")
Send("{LWINUP}")
$Pixel = PixelSearch(14,288,42,316,0x58A6F7);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1
If Not @error Then;if it did find it then
    MouseMove($Pixel[0], $Pixel[1] , 0 );move the mouse to it instantly
    MouseClick("");click the left mouse button
EndIf
EndFunc

This should work?

All it does is open up the menu?

Edited by Maxisking
  • Moderators
Posted

TestProgram()
Func TestProgram()
Send("{LWINDOWN}")
Send("{LWINUP}")
$Pixel = PixelSearch(14,288,42,316,0x58A6F7);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1
If Not @error Then;if it did find it then
    MouseMove($Pixel[0], $Pixel[1] , 0 );move the mouse to it instantly
    MouseClick("");click the left mouse button
EndIf
EndFunc

This should work?

All it does is open up the menu?

Are you seriously asking us this question? Are we to know what in the world you're doing? lol...

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.

Posted

O srry ill explain, first it opens up The windows menu, then it find the windows live messenger icon and clicks it.

prety simple but it doesnt seem to be working. :P

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...