

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
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
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
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
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 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
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
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
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
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
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
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
Users browsing this forum: AHKStudent, Bing [Bot], Chunjee, Marcosa1020 and 239 guests