need help to make reminder
need help to make reminder
pls help me i want to make a reminder every 20 minutes of the clock not a countdown like example 10:20pm, 10:40pm, 11:00pm and so on, a message box will pop up. can someone pls help me?
Re: need help to make reminder
The simplest way:
The issue with the above is you'd have to manually launch it when you want a message to appear for it to be synchronized.
The slightly more difficult way that doesn't need manual launching at the time you would want a message to appear:
I might be wrong on the maths in the second one though.
Code: Select all
#Persistent
SetTimer, Reminder, % 20*60*1000 ; 1000 milliseconds to a second, 60 seconds to a minute, 20 minutes
return
Reminder:
MsgBox Hi
return
The slightly more difficult way that doesn't need manual launching at the time you would want a message to appear:
Code: Select all
#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
Re: need help to make reminder
yeah, I'm a little bit late, but maybe you like my solution:
kissed by the muse, I came up with simpler version. enjoy!
Code: Select all
#Persistent
SetTimer, CheckTime, 60000
CheckTime:
FormatTime, TimeString,, mm
If (TimeString = 00 ) Or (TimeString = 20) Or (TimeString = 40)
{
MsgBox Your time has come! :)
}
return
Code: Select all
#Persistent
SetTimer, CheckTime, 60000
CheckTime:
If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40)
MsgBox This time, for sure!
Return
Last edited by Asmodeus on 01 May 2016, 16:05, edited 1 time in total.
Re: need help to make reminder
Thank you for the reply. As is I see in the posts, I think Asmodeus gave the solution. But i'll test it and give a feedback.
Re: need help to make reminder
Hi Asmodeus. Is the script continuous? won't it stop? i need the script to always remind me till i exit the script.
Re: need help to make reminder
i'll try this one too. I don't want to waste your effort helping me. Tahnk you. I'll give feedback.Exaskryz wrote:The simplest way:
The issue with the above is you'd have to manually launch it when you want a message to appear for it to be synchronized.Code: Select all
#Persistent SetTimer, Reminder, % 20*60*1000 ; 1000 milliseconds to a second, 60 seconds to a minute, 20 minutes return Reminder: MsgBox Hi return
The slightly more difficult way that doesn't need manual launching at the time you would want a message to appear:
I might be wrong on the maths in the second one though.Code: Select all
#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
Re: need help to make reminder
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.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.
This is because of the #Persistent directive. Click on it in the code section to open the corresponding help file.
Re: need help to make reminder
Thank you Asmodeus. It works as i wanted. What if I want to change the size of the message box? I want to make the box smaller. The alert box was spacious, i don't like it.
Re: need help to make reminder
You may want to opt for a GUI instead.
Re: need help to make reminder
This is the script that I chosen. How can i opt a Gui here and where will i put it? Im sorry for asking but im really noob here. All i know is the send command. Can you pls guide me?Exaskryz wrote:You may want to opt for a GUI instead.
Code: Select all
#Persistent
SetTimer, CheckTime, 60000
CheckTime:
If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40)
MsgBox This time, for sure!
Return
Re: need help to make reminder
I had a glance in gui docs. I want the gui to be simply small, centered, word wrapped, and always on top when it showed. Can you help me Exaskryz? Can you pls help me with the code?
Re: need help to make reminder
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.
Code: Select all
#Persistent
SetTimer, CheckTime, 60000
CheckTime:
If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40)
Gui +AlwaysOnTop
Gui, Add, Text, Center, Audit na!
Gui, Add, Button, Default, OK
Gui, Show
Return
Re: need help to make reminder
I need some help even from other members...
Re: need help to make reminder
Try this:
I hope that helps.
Code: Select all
Gui +AlwaysOnTop
Gui, Add, Text, Center, Audit na!
Gui, Add, Button, Default, OK
SetTimer, CheckTime, 1000
CheckTime:
If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40)
Gui, Show
Return
ButtonOK:
Gui, Hide
Return
Re: need help to make reminder
It did not solve my problem, wolf. Nothing shows after hitting time in the clock. Pls help.wolf_II wrote:Try this:I hope that helps.Code: Select all
Gui +AlwaysOnTop Gui, Add, Text, Center, Audit na! Gui, Add, Button, Default, OK SetTimer, CheckTime, 1000 CheckTime: If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40) Gui, Show Return ButtonOK: Gui, Hide Return
Re: need help to make reminder
Anybody wants to help me?
Re: need help to make reminder
Code: Select all
#NoEnv
#SingleInstance force
#Persistent
Gui +AlwaysOnTop -Caption
Gui, Add, Text, Center, Audit na!
Gui, Add, Button, Default, OK
SetTimer, CheckTime, 1000
oTime := A_Min
Return
CheckTime:
If (oTime < A_min) && ((A_Min = 00) OR (A_Min = 20) OR (A_Min = 40)){
oTime := A_min
Gui, Show
}
Return
ButtonOK:
Gui, Hide
Return
Donec Perficiam
Re: need help to make reminder
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.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.
Code: Select all
#Persistent SetTimer, CheckTime, 60000 CheckTime: If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40) Gui +AlwaysOnTop Gui, Add, Text, Center, Audit na! Gui, Add, Button, Default, OK Gui, Show Return
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.
Re: need help to make reminder
Thanks wolf for the script. It did solve my prob. Ill just have to change the timer. Thank you very much.wolf_II wrote:Try this:I hope that helps.Code: Select all
Gui +AlwaysOnTop Gui, Add, Text, Center, Audit na! Gui, Add, Button, Default, OK SetTimer, CheckTime, 1000 CheckTime: If (A_Min = 00) OR (A_Min = 20) OR (A_Min = 40) Gui, Show Return ButtonOK: Gui, Hide Return