Alex1 Posted May 20, 2007 Posted May 20, 2007 I'd like to make the mouse double click every 5 minutes. How do I do this?
Pakku Posted May 20, 2007 Posted May 20, 2007 (edited) Hi, While 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) Sleep(1000 * 60 * 5) WEnd p.s. please first take a look at the help file Edited November 16, 2010 by Pakku How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me
Paulie Posted May 20, 2007 Posted May 20, 2007 (edited) I'd like to make the mouse double click every 5 minutes. How do I do this?While 1 Mouseclick("Left",X, Y, 2, 0) Sleep(5*60*1000) WEnd Edited May 20, 2007 by Paulie
Pakku Posted May 20, 2007 Posted May 20, 2007 While 1 Mouseclick("Left",X, Y, 2, 0) Sleep(5*60*1000) WEnd i updated my post while you were adding one How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me
Paulie Posted May 20, 2007 Posted May 20, 2007 i updated my post while you were adding one lol i got beat...
Alex1 Posted May 20, 2007 Author Posted May 20, 2007 hmm... why isn't this double clicking every 10 seconds While 1 $slp = Random(20000, 60000, 1) Sleep($slp) Send("{F3}") Sleep(5500) Send("{F1}") WEnd While 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) Sleep(10000) WEnd
Paulie Posted May 20, 2007 Posted May 20, 2007 hmm... why isn't this double clicking every 10 seconds While 1 $slp = Random(20000, 60000, 1) Sleep($slp) Send("{F3}") Sleep(5500) Send("{F1}") WEnd While 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) Sleep(10000) WEndMost likely because it is stuck in the first loop.
Vindicator209 Posted May 20, 2007 Posted May 20, 2007 (edited) You've got 2 loops there: While 1 $slp = Random(20000, 60000, 1) Sleep($slp) Send("{F3}") Sleep(5500) Send("{F1}") WEnd While 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) Sleep(10000) WEnd They happen one after nother, but since they are both infinite loops, the second doesnt get done, and I dont know enough about loops to tell you how to dodge that but you can do this: $timer=TimerInit() ;set time 1 $timer2=TimerInit() ; set timer 2 $slp = Random(20000, 60000, 1) ;set random While 1 If TimerDiff($timer) > 10000 Then ; Check timer 1 _Function1 EndIf If TimerDiff($timer2) > $slp Then ; Check timer 2 _Function2 EndIf Func _Function1() ;Function 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) $timer=TimerInit(); Reset Timer EndFunc Func _Function2() $slp = Random(20000, 60000, 1) $timer2=TimerInit(); Reset Timer Send("{F3}") Sleep(5500) Send("{F1}") EndFunc I havent tested that but something along those lines should work Edited May 20, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Paulie Posted May 21, 2007 Posted May 21, 2007 how do i make it not do that?You can set a hotkey to do one and a different one for the other. ie: Hotkeyset("1", "_one") Hotkeyset("2", "_two") while 1 sleep(100) WEnd Func _one() While 1 $slp = Random(20000, 60000, 1) Sleep($slp) Send("{F3}") Sleep(5500) Send("{F1}") WEnd EndFunc Func _two() While 1 $pos = MouseGetPos() MouseClick("left",$pos[0],$pos[1],2) Sleep(10000) WEnd EndFunc
Alex1 Posted May 21, 2007 Author Posted May 21, 2007 hmm... Paulie it doesn't repeat on its own with that, though.
Paulie Posted May 21, 2007 Posted May 21, 2007 hmm... Paulie it doesn't repeat on its own with that, though.It does for me....You have to push the hotkeys to make it work though.If you push 1, it will do the first loop (the one without clicking)Then you push 2 and it wil stop doing the first loop and do the mouse clicks.
Alex1 Posted May 21, 2007 Author Posted May 21, 2007 Well, my goal here is to be able to have a repeating loop the pressing f1 and f3, and a repeating loop of double clicking every 5 minutes (10 seconds for the test). I don't want to have to press 1 and 2 and stay at my computer for the script to work. Thanks for all your help by the way, guys
Vindicator209 Posted May 21, 2007 Posted May 21, 2007 (edited) You don't have to stay at your computer, just press 1 and 2 for the first time and it will do it on its own from then on =P Edited May 21, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Alex1 Posted May 21, 2007 Author Posted May 21, 2007 Well, when I press 2, the one script stops working. When I press 1, the 2 script stops working.
Vindicator209 Posted May 21, 2007 Posted May 21, 2007 Really? well then make 2 scripts lol =P [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
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