Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Loop Timer Help


  • Please log in to reply
4 replies to this topic
Cardboardts
  • Members
  • 3 posts
  • Last active: Mar 12 2007 12:01 PM
  • Joined: 12 Mar 2007
Ok here is the script that im currently using:

#Z::

Loop,
{
IfEqual, x, 1
Break
;CoordMode, Mouse, Screen
MouseClick, Left, 435, 481
}
RETURN
#X::x=1

It's Pretty simple and id like to advance it to something like this:


;CoordMode, Mouse, Screen
Mouse Click, Left, 118, 746_____60 second pause
Mouse Click, Left, 524, 100_____40 second pause
Mouse Click, Left, 862, 135_____.5 second pause
Mouse Click, Left, 862, 135_____1 second pause
Mouse Click, Left, 883, 138_____60 second pause
Mouse Click, Left, 872, 184_____1 second pause
Mouse Click, Left, 685, 215_____15 second pause
Mouse Click, Left, 698, 239_____15 second pause
Mouse Click, Left, 425, 513_____15 second pause
Mouse Click, Left, 426, 418_____*loop repeated clicks 15 mins*
Mouse Click, Left, 958, 197_____15 second pause
Mouse Click, Left, 958, 197_____15 second pause
Mouse Click, Left, 862, 135_____.5 second pause
Mouse Click, Left, 862, 135_____1 second pause
Mouse Click, Left, 863, 156_____60 second pause
Mouse Click, Left, 873, 182_____1 second pause
Mouse Click, Left, 685, 215_____15 second pause
Mouse Click, Left, 698, 239_____15 second pause
Mouse Click, Left, 425, 513_____15 second pause
Mouse Click, Left, 426, 418_____*loop repeated clicks 15 mins*

I have no idea how to make the loop of the mouse clicking set to a timer for 15 mins. Also how would you implement the pauses between the clicks?


Any info or help would be awesome!

partyhat
  • Guests
  • Last active:
  • Joined: --
Mouse Click, Left, 118, 746 ;_____60 second pause 
sleep, 60000
Mouse Click, Left, 524, 100 ;_____40 second pause 
sleep, 40000
Mouse Click, Left, 862, 135 ;_____.5 second pause 
sleep, 500
Mouse Click, Left, 862, 135 ;_____1 second pause 
sleep, 1000
Mouse Click, Left, 883, 138 ;_____60 second pause 
sleep, 60000
Mouse Click, Left, 872, 184 ;_____1 second pause 
sleep, 1000
Mouse Click, Left, 685, 215 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 698, 239 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 425, 513 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 426, 418 ;_____*loop repeated clicks 15 mins* 
Mouse Click, Left, 958, 197 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 958, 197 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 862, 135 ;_____.5 second pause 
sleep, 5000
Mouse Click, Left, 862, 135 ;_____1 second pause 
sleep, 1000
Mouse Click, Left, 863, 156 ;_____60 second pause 
sleep, 60000
Mouse Click, Left, 873, 182 ;_____1 second pause 
sleep, 1000
Mouse Click, Left, 685, 215 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 698, 239 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 425, 513 ;_____15 second pause 
sleep, 15000
Mouse Click, Left, 426, 418 ;_____*loop repeated clicks 15 mins*

Now I dont really know a command to make it loop for exactly 15 minutes, but if you added the seconds together and found out how many times it could run in fifteen minutes, then just take that number and put it after the loop command with a comma after loop.

ex. Loop, 10

I think I understand what you want, and hope I helped a little.

Veovis
  • Members
  • 389 posts
  • Last active: Mar 17 2009 12:24 AM
  • Joined: 13 Feb 2006
you can use sleep to pause between your clicks

and using %A_now% and addition, then a loop, you could loop for fifteen minutes

for ex:

endtime = %A_now%
endtime += 15,minutes

loop
{
if A_now > endtime
   break
mouseclick, blah,blah
sleep, 300 ;just so were not clicking completely madly
}
return

^+]::exitapp   ;just in case the script gets out of control, press control-shift-]


Cardboardts
  • Members
  • 3 posts
  • Last active: Mar 12 2007 12:01 PM
  • Joined: 12 Mar 2007
Wow thank for all the help!
This is what it has turned out to be.

#Z::


;CoordMode, Mouse, Screen
MouseClick, Left, 118, 746
sleep, 20000
MouseClick, Left, 524, 100
sleep, 20000
MouseClick, Left, 862, 135
sleep, 500
MouseClick, Left, 862, 135
sleep, 1000
MouseClick, Left, 883, 138
sleep, 1000
MouseClick, Left, 872, 184
sleep, 10000
MouseClick, Left, 685, 215
sleep, 5000
MouseClick, Left, 698, 239
sleep, 15000
MouseClick, Left, 425, 513
sleep, 15000

endtime = %A_now%
endtime += 2,minutes

loop
{
if A_now > endtime
break
;CoordMode, Mouse, Screen
MouseClick, Left, 423, 480
sleep, 300
}
return

^+]::exitapp
sleep, 15000

MouseClick, Left, 958, 197
sleep, 15000
MouseClick, Left, 958, 197
sleep, 15000
MouseClick, Left, 862, 135
sleep, 5000
MouseClick, Left, 862, 135
sleep, 1000
MouseClick, Left, 863, 156
sleep, 1000
MouseClick, Left, 873, 182
sleep, 10000
MouseClick, Left, 685, 215
sleep, 5000
MouseClick, Left, 698, 239
sleep, 15000
MouseClick, Left, 425, 513
sleep, 15000

endtime = %A_now%
endtime += 2,minutes

loop
{
if A_now > endtime
break
;CoordMode, Mouse, Screen
MouseClick, Left, 423, 480
sleep, 300
}
return

#X::exitapp


The only problem is the timer, I think. The two segments work fine on their own, yet the loop will not stop at the appropriate time. It just keeps going and going. and never starts the second part.

Any ideas?

Cardboardts
  • Members
  • 3 posts
  • Last active: Mar 12 2007 12:01 PM
  • Joined: 12 Mar 2007
I fixed it. Here is the new fully working code it rocks, thanks again for the help!

#Z::


;CoordMode, Mouse, Screen
MouseClick, Left, 118, 746
sleep, 20000
MouseClick, Left, 524, 100
sleep, 20000
MouseClick, Left, 862, 135
sleep, 500
MouseClick, Left, 862, 135
sleep, 1000
MouseClick, Left, 883, 138
sleep, 1000
MouseClick, Left, 872, 184
sleep, 10000
MouseClick, Left, 685, 215
sleep, 5000
MouseClick, Left, 698, 239
sleep, 15000
MouseClick, Left, 425, 513
sleep, 15000


loop, 1200
{
   IfEqual, x, 1
     Break 
   ;CoordMode, Mouse, Screen
MouseClick, Left, 423, 480
sleep, 300 
}


sleep, 15000

MouseClick, Left, 958, 197
sleep, 15000
MouseClick, Left, 958, 197
sleep, 15000
MouseClick, Left, 862, 135
sleep, 5000
MouseClick, Left, 862, 135
sleep, 1000
MouseClick, Left, 863, 156
sleep, 1000
MouseClick, Left, 873, 182
sleep, 10000
MouseClick, Left, 685, 215
sleep, 5000
MouseClick, Left, 698, 239
sleep, 15000
MouseClick, Left, 425, 513
sleep, 15000

loop, 1200
{
   IfEqual, x, 1
     Break 
   ;CoordMode, Mouse, Screen
MouseClick, Left, 423, 480
sleep, 300 
}
return

#X::x=1