Jump to content

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

Start, stop, and restart a loop with a timer.


  • Please log in to reply
1 reply to this topic
DrexOtter
  • Members
  • 2 posts
  • Last active: Oct 24 2015 05:13 PM
  • Joined: 24 Oct 2015

Hello! I am trying to figure out what I think should be a fairly simple script. I've already got a partly working version but it only does what I want it to do once and then does nothing else. Basically what I want to have happen is, the macro starts, it then spams left click over and over very fast for 5 seconds. It then stops the loop, waits for 5 seconds, left clicks just once, waits for 5 seconds, and then starts the loop over again and runs the whole process over. It also has a key that starts and pauses the macro, but that's already working, so I just need help with the other part.

 

So start > loop left clicks for 5 seconds > stop loop > wait 5 seconds > click once > wait 5 seconds > do it all over again.

 

Here is what I have so far:

start := A_TickCount

while (A_TickCount-start <= 5000)
{
send {LButton}
sleep, 10
}

sleep 5000
send {LButton}
sleep 5000

f7::
Pause
return

Thanks!



DrexOtter
  • Members
  • 2 posts
  • Last active: Oct 24 2015 05:13 PM
  • Joined: 24 Oct 2015

I figured out a solution for this that works for me. If anyone has the same issue, the code I used is:

loop
{
	start := A_TickCount

	while (A_TickCount-start <= 5000)
	{
	send {LButton}
	sleep, 10
	}

	sleep 5000
	send {LButton}
	sleep 5000
	start = 0
}

f7::
Pause
return