Jump to content
Sign in to follow this  
washer

Auto Click

Recommended Posts

washer

Hey I'm new here and i have very little understanding of programming. I had a search through the forums and couldn't find what i was looking for so i thought i would attempt to post a thread.

What i am after is a script/program that will automatically click a button which appears on the screen at random intervals. If there is one on this site and i have missed it I'm sorry, but any help with links or names to search for i will be thankful. This Button has a name but never in the same position.

Cheers

Edited by washer

Share this post


Link to post
Share on other sites
d4rk

PixelSearch()

MouseClick()

Edited by d4rk

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
Backnor

open up autoit info tool and find the x and y cord (top left of the box u want to search) then the x and y of the bottom right of the box u want to search.

first x and y cords use them in pixel search(x, y, now the second set use in the next set of cords for pixel search followed by the hex# for the color u are trying to find. Last thing is the color variation u want to use (it will find the hex color plus or minus, thus called shade variation)

use  $color = PixelSearch(x, y, x1, y1, 0x000000, 5)

While 1
$color = PixelSearch(x, y, x1, y1, 0x000000, 5)
If IsArray($pixel) = 1 Then; If Pixel has been found
MouseClick('left', $pixel[0], $pixel[1], 1, 0); Click on the pixel
EndIf
WEnd

hope this helps a little

Edited by Backnor

Share this post


Link to post
Share on other sites
cal

That seems like a lot of work. Its very likely that this "Button" is part of an error window that pops up. Use the info tool to find the name of the window. It could be as simple as sending an enter whenever the window pops up. or send a ControlClick directly to the button when the window shows.

Unless its part of a Game or something else that has direct control of the screen then I would avoid using the pixel functions.

I think PixelChecksum is more useful. And I admit I've used it myself when I could not figure out a better way of detecting something.

Edited by cal

Share this post


Link to post
Share on other sites
washer

thanks i got it working but im wondering if theres a way to double click i added the line twice doesnt seem to help any ideas?

Share this post


Link to post
Share on other sites
muzle6074

thanks i got it working but im wondering if theres a way to double click i added the line twice doesnt seem to help any ideas?

MouseClick ("Left", x, y, 2, 0)

the 2 is how many clicks. 2 will click twice ofc :P

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.