#Persistent
SetTimer, Reminder, % -1 * (Mod(A_Min,20)*60000 - A_Sec*1000) ; The negative from the -1 means to run this timer only once
; It's 10:30:35, we need a timer of 9:25. The Mod(30,20) gives us a remainder of 10 minutes, multiplied into milliseconds. We also want to subtract 35 seconds off to hit the target 9:25, and converted that to milliseconds as well.
return
Reminder:
SetTimer, Reminder, % -1 * (Mod(A_Min,20)*60000 - A_Sec*1000) ; can be used instead of 20*60*1000 for repeating just in case something happens and it desyncs, this will resync it
MsgBox Hi
return

#Persistent
SetTimer, Reminder, % -1 * (Mod(A_Min,20)*60000 - A_Sec*1000) ; The negative from the -1 means to run this timer only once
; It's 10:30:35, we need a timer of 9:25. The Mod(30,20) gives us a remainder of 10 minutes, multiplied into milliseconds. We also want to subtract 35 seconds off to hit the target 9:25, and converted that to milliseconds as well.
return
Reminder:
SetTimer, Reminder, % -1 * (Mod(A_Min,20)*60000 - A_Sec*1000) ; can be used instead of 20*60*1000 for repeating just in case something happens and it desyncs, this will resync it
MsgBox Hi
return

neosickle wrote:Hi Asmodeus. Is the script continuous? won't it stop? i need the script to always remind me till i exit the script.

I will work forever until you kill the process or someone suspends the process or you turn off your computer or ah you get the point.
This is because of the #Persistent directive. Click on it in the code section to open the corresponding help file.

Exaskryz wrote:Instead of the MsgBox, I would use just a Gui, Show. It'll come together in a moment.

In the auto-execute section, you would create the GUI. Using Gui, Add, Text,,Your Message should suffice. Then as you want to customize it, you can read through the Gui docs.

I tried to put gui in the script. I also put ok button into it. The size of the gui is perfect than msgbox gives for me. But the problem is when i execute the script it displays the message instantly, the gui must appear only as i indicated in my script and when i press the ok button nothing happens. It must close the window after pressing ok. Pls help. Here's what i have done.

neosickle wrote:
I tried to put gui in the script. I also put ok button into it. The size of the gui is perfect than msgbox gives for me. But the problem is when i execute the script it displays the message instantly, the gui must appear only as i indicated in my script and when i press the ok button nothing happens. It must close the window after pressing ok. Pls help. Here's what i have done.

The MsgBox was appearing like that because you didn't put a Block with the If statement. Use of { and } are necessary if you want more than one line to be executed only when the if statement is true.

However, you may find this is a bit problematic, because it will add the Text and Button controls repeatedly. While technically you have this in the auto-execute section, I'd suggest moving it above the label. I suggest having only the Gui, Show associated with the If statement - you also won't need a Block in that situation.

Now, that suggestion I have is what wolf's code demonstrates. It should be working; I see no reason it shouldn't be. It would be problematic though because it will actually be checking too frequently; wolf changed his timer to 1000 instead of 60000, which means that the GUI may reappear within the exact same minute after you dismiss it. So I'd suggest he put the timer back on 60000.

I executed wolf's code, and that's the behavior I got actually. A GUI that kept showing itself. With the timer on 60000 (or using the maths I originally suggested), you could have that problem resolved.