Sign in to follow this  
Followers 0
XZ3R0

Simple Script

9 posts in this topic

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.

Share this post


Link to post
Share on other sites



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


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

To enable the "Sleep ( delay )" command to wait till 60 seconds elapse to get a more of a feel but I assume having 1000 meaning 1 second is more your style


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Ok i got it to work, all i need is to make it stop after 60 seconds. where and how do i put this code in?

$i=$i+1
? Edited by XZ3R0

Share this post


Link to post
Share on other sites

Put a timer default of 60 seconds then


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

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