AngelzUnit Posted February 3, 2007 Posted February 3, 2007 Hey everyone, I was wondering if there was a way so I can move my mouse, say on a button, and run the script and it will automatically click on the button every 'x' seconds. I really dont need it to find a place to click or anything, just click.
Moderators SmOke_N Posted February 3, 2007 Moderators Posted February 3, 2007 Hey everyone, I was wondering if there was a way so I can move my mouse, say on a button, and run the script and it will automatically click on the button every 'x' seconds. I really dont need it to find a place to click or anything, just click.http://www.autoitscript.com/autoit3/docs/functions.htm (You'd be amazed at what you find using the exact terms you are using above). Check out ControlClick(). 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.
BALA Posted February 3, 2007 Posted February 3, 2007 (edited) You would have to constantly get the position of the cursor (try using MouseGetPos) , then have it keep track of the time (search the help file for time, you'll get a bunch of commands), then have a MouseClick command click where the position of the mouse you record is when it's the right time.EDIT: Or you can try the easier way that Sm0ke_N gave Edited February 3, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
AngelzUnit Posted February 3, 2007 Author Posted February 3, 2007 Well I got this to click for me, I just need to know how to make it do it over and over, it does it once fine, but it just stops after ; Double click at the current mouse pos MouseClick("left") MouseClick("left")
BALA Posted February 3, 2007 Posted February 3, 2007 (edited) Well I got this to click for me, I just need to know how to make it do it over and over, it does it once fine, but it just stops after ; Double click at the current mouse pos MouseClick("left") MouseClick("left") Put it in a loop, with a sleep command While 1 MouseClick("left") MouseClick("left") Sleep(2000) ; Wait 2 seconds WEnd Edited February 3, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Paulie Posted February 3, 2007 Posted February 3, 2007 Put it in a loop, with a sleep command While 1 MouseClick("left") MouseClick("left") Sleep(2000) ; Wait 2 seconds WEndoÝ÷ Ûú®¢×ºÛaȬj¢Ú,¶hDz¢çhÁ©íÛh¡«"¶+¢{-j{eÉÉbrH§Þr¦zwZuاØb±«¢+Ø)!½ÑåÍÐ ÅÕ½ÐííM ôÅÕ½Ðì°ÅÕ½ÐíEÕ¥ÐÅÕ½Ðì¤)]¡¥±Ä(%5½ÕÍ ±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì¤(%5½ÕÍ ±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì¤(%M±À ÈÀÀÀ¤ì]¥ÐÈͽ¹Ì)]¹)Õ¹EեР¤)á¥Ð)¹Õ¹( Now pushing ESC makes it stop.
herewasplato Posted February 3, 2007 Posted February 3, 2007 http://www.autoitscript.com/forum/index.ph...st&p=165936 [size="1"][font="Arial"].[u].[/u][/font][/size]
Paulie Posted February 3, 2007 Posted February 3, 2007 http://www.autoitscript.com/forum/index.ph...st&p=165936Lol, i knew there were better ways to make it stop/pause, but my way was quick and beat having no stopping at all.
cppman Posted February 3, 2007 Posted February 3, 2007 instead of using sleep you can use my timer functions.. It will call your "Click" function every x seconds..http://www.autoitscript.com/forum/index.php?showtopic=40177here is an example:#include "timer.au3" Func _Click() ;Put the code here that you want to execute every x seconds(clicking the mouse) ;use controlclick to click your Control EndFunc $timer = _TimerCreate("_Click", 1000) ;calls _Click every second while(true) _TimerUpdate($timer) WEnd Miva OS Project
herewasplato Posted February 4, 2007 Posted February 4, 2007 Lol, i knew there were better ways to make it stop/pause, but my way was quick and beat having no stopping at all. You could/should add a hotkey/exit (like yours) to the GUI in that link to kill it when using subsecond click rates....or is there another way to kill it that I'm not seeing in the code? Alt-F4 won't work unless you can get the GUI into focus between clicks (assumes that you are not clicking on the GUI itself :-)...but if the goal is AFK clicks 20 to 30 seconds apart, then you have enough time to move the mouse and stop the script via the existing GUI code. [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now