Jump to content

Simple Script


Recommended Posts

What i want to do is define a an area for the scrip to search for several colors. When those colors appear on the screen i want to have the script click on them (preferably by moving the mouse there and clicking on it, not just simulated). The only variable in here is that the "colors" will be moving.

This is what i have right now:

Sleep (5000)
While 1=1
    $i=0
    While $i<1
        $coor = PixelSearch( 5, 50, 720, 590, 0x16696891, 10, 1 )
        While @error = 0
            Send(LCLICK)
            Sleep(1000)
            $coor = PixelSearch( 5, 50, 720, 590, 0x16696891, 10, 1 )
            $i=0
        WEnd
    WEnd
WEnd

I am assuming that Send(lclick) is wrong and i should use ControlClick() but i don't know how to make it recognize the moving variables.

So here's my questions: How do i use controlclick and make it recognize variables? how would i make it work on more than one color? Is this looped correctly? How can i make it loops for only 60 seconds? and is there anything else wrong with this code?

I'm new to this so ill take all the help i can get.

Link to comment
Share on other sites

You use "ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )" if you don't want to see the window but you want it to be active. Some programs disable this but many programs still run it

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

I would look at arrays to quickly do you mathematics so you can get more then "0x16696891" colors in there. Also lookup Loops Statement to find out how to work them with the arrays

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

Use "MouseClick ( "button" [, x, y [, clicks [, speed ]]] )" Because you don't have a LCLICK modified to work on here

Ok i figured out the MouseClick thing on my own but i still dont know how to use it correctly. What do i put for "button" when i put left it gives me an error.

Heres the code im using, is this correct?

MouseClick ( "Left", $Coord[0], $Coord[1], 1, 0 )
Edited by XZ3R0
Link to comment
Share on other sites

MouseClick("left", $Coord[0], $Coord[1], 1, 0)

Don't put the [] things inside that is only if you have them to signify them. So MouseClick("left") would work but doesn't move the move

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

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