You may want make that F7 a hotkey (double colon)? But if you only want it controlled by the menu, I'd recommend not using a key name just to avoid that confusion. It's fine do use just an F7: label if you really want to.

Exaskryz wrote:You may want make that F7 a hotkey (double colon)? But if you only want it controlled by the menu, I'd recommend not using a key name just to avoid that confusion. It's fine do use just an F7: label if you really want to.

I would recommend using SetTimer instead of a Loop to do your commands. You can use If with A_ThisMenuItem to know if you clicked the Start or Stop planting. You can then turn on or off timers.

Yea I've got the rest of the script done, and F7 is an alternative hotkey for when I don't want to reach for the menu.
(Oh yea I didn't notice that I put just one double colon, thanks)
I tried settimer but I keep messing up that's why I need help, I have no clue what or how to do that.

If you wanted to stop it midway, make sure you call both SetTimer, mylabel, Off and counter_A:=0or make sure counter_A:=0 is always done when you turn On the timer. If you don't, you could interrupt the script when counter_A is equal to 72, and only 28 iterations later it would turn the timer off.

When you do reach the If counter_A=100, you can then have it jump to the part of the script you want running after it, which appears to be this code, with GoSub:

You'd need to code in the If check after the Sleep, 2000. And for each sleep, unless you don't mind it running to completion.

The way that I would manage running the code for an hour, because you won't have always perfectly exact sleeps, is capturing the variable A_TickCount when you start the process. (When If toggle3 is true). Then each time the timer subroutine runs, it should check to make sure (start_tickcount + 3600000 > A_TickCount). I think that number is right; TickCount is in milliseconds. There are 60 seconds to a minute, 60 minutes to an hour, so that's 3600 seconds to an hour. Times 1000 is 3600000 (five zeroes).

Go ahead and give it a stab to assembling all this code. Then we can see what is missing or if things need to be moved around to have good logic. It is late for me, so I apologize if anything I said doesn't make good sense. Thoughts trailing off or just not moving from my brain to my fingers.