![]() |
Re: Certain script run at a certain time
Quote:
Code:
GetTime(Hour,x,y)Thanks so much for clarifing everything , and making things understandable ! in my java programming course , he makes us wright an algorithm before any code is allowed to be written , I tried that with this mort script , but not fully understanding the code and unix timestamp crap , I failed . Lol . Seriously , I can't say thanks enough . |
Re: Certain script run at a certain time
I like your method a little more actually. The only downside would be that mortscript would be loaded in memory during the Sleep() function. I don't know how well it would fare against system freezes or reboots, or maybe even conflicts from other scripts.
For what it's worth, you can use that method in conjunction with Unix time. Something like: Wait = *seconds from now until midnight calculated in your algorithm up there* varScheduleTime = TimeStamp() + Wait <-- this will store the Unix time of tomorrow @midnight RemoveNotifications(...) RunAt(varScheduleTime,...,...) Actually, I think I'll revise mine to work like that! I have an script that uploads two backups to my FTP server every day. The idea is that I can be up and running immediately if my phone is lost/stolen! |
Re: Certain script run at a certain time
It's all the same thing lol. I couldn't see it until I tried simplifying it to give the cpu fewer calculations to perform.
Code:
GetTime(varH,varM,varS)Code:
GetTime(varH,varM,varS)Code:
GetTime(varH,varM,varS) |
Re: Certain script run at a certain time
Quote:
|
Re: Certain script run at a certain time
Yeah follows regular order of operations. I have a pair of extra parantheses above just to make it easier to read, so you can ignore that.
Also, you need to use (23-varH) otherwise you'll end up with 25hr days. Try it with 22:30... if you use 24 for the number of hours, the result will 2.5hrs until midnight :) You can always do use Message() to display the current value of variables for testing and troubleshooting, something like Message("hours= " & varH) or even Message(TimeStamp()) !! |
Re: Certain script run at a certain time
Quote:
|
Re: Certain script run at a certain time
If it works, it works! Just make sure to double-check your time and you're golden :)
|
Re: Certain script run at a certain time
yes sir ! thanks so much for all your help !
|
| All times are GMT -4. The time now is 04:41 PM. |
Powered by vBulletin® ©2000 - 2025, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com