PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 04-12-2011, 09:30 AM
elesbb's Avatar
Super genious in training
Offline
Pocket PC: HTC Touch Pro 2
Carrier: Sprint
Threadstarter
Location: PA
 
Join Date: Jun 2010
Posts: 1,198
Reputation: 1600
elesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on rep
Mentioned: 42 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Quote:
Originally Posted by quick99si View Post
Tell me if this helps (I apologize in advance for the lengthy notes!).
that's perfection .. You rock , wish I could hit the thanks button a million times . You have no idea how much you have clariied things for me , don't ever apologize for lengthly notes ! they help so much ! I created my own script but the coding is exactly like yours , just different variable names . One thing I also was able to use , was this :
Code:
GetTime(Hour,x,y)
Wait=(24-Hour)
Wait=(Wait*3600)
x=60-x
x=x*60
Wait =Wait+x
Wait=Wait*1000
Sleep(Wait)
Run("\Program Files\elesbb\Set Sleep Time\Sleep 5 Seconds.mscr")
exit
this works for what I want it to do .. But having it in the notification queue . I feel that would be best .
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 .
Reply With Quote
This post has been thanked 1 times.
  #22 (permalink)  
Old 04-12-2011, 10:29 AM
quick99si's Avatar
Halfway to VIP Status
Offline
Pocket PC: Nexus S - E3GT - Epic 3G
Carrier: SERO $30
Location: Chicago, IL
 
Join Date: Dec 2007
Posts: 631
Reputation: 1245
quick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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!
Reply With Quote
  #23 (permalink)  
Old 04-12-2011, 11:05 AM
quick99si's Avatar
Halfway to VIP Status
Offline
Pocket PC: Nexus S - E3GT - Epic 3G
Carrier: SERO $30
Location: Chicago, IL
 
Join Date: Dec 2007
Posts: 631
Reputation: 1245
quick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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)
varSecondsUntilMidnight = ((23-varH)*3600) + (59-varM)*60) + (60-varS))
varMidnightUnix = TimeStamp() + varSecondsUntilMidnight
Code:
GetTime(varH,varM,varS)
varSecondsUntilMidnight = 86400 - (varH*3600) - (varM*60) - varS
varMidnightUnix = TimeStamp() + varSecondsUntilMidnight
Code:
GetTime(varH,varM,varS)
varMidnightUnix = TimeStamp() + 86400 - (varH*3600) - (varM*60) - varS
Reply With Quote
  #24 (permalink)  
Old 04-12-2011, 11:36 AM
elesbb's Avatar
Super genious in training
Offline
Pocket PC: HTC Touch Pro 2
Carrier: Sprint
Threadstarter
Location: PA
 
Join Date: Jun 2010
Posts: 1,198
Reputation: 1600
elesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on rep
Mentioned: 42 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Quote:
Originally Posted by quick99si View Post
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)
varSecondsUntilMidnight = ((23-varH)*3600) + (59-varM)*60) + (60-varS))
varMidnightUnix = TimeStamp() + varSecondsUntilMidnight
Code:
GetTime(varH,varM,varS)
varSecondsUntilMidnight = 86400 - (varH*3600) - (varM*60) - varS
varMidnightUnix = TimeStamp() + varSecondsUntilMidnight
Code:
GetTime(varH,varM,varS)
varMidnightUnix = TimeStamp() + 86400 - (varH*3600) - (varM*60) - varS
haha ! yes . and make sure if you want midnight , to make it 24 , not 23 , hence , 24 hours in a day . and you can actually use that for any time , say you want it at 10 , then you would use 22 , I kinda like this method too , I really don't think the memory usage is all that high , but if I shut off my phone or restart , the script ends , where your first version , gets saved in the notification queue . and just a random question , does Mort script follow order of operations ?
Reply With Quote
  #25 (permalink)  
Old 04-12-2011, 12:35 PM
quick99si's Avatar
Halfway to VIP Status
Offline
Pocket PC: Nexus S - E3GT - Epic 3G
Carrier: SERO $30
Location: Chicago, IL
 
Join Date: Dec 2007
Posts: 631
Reputation: 1245
quick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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()) !!
Reply With Quote
  #26 (permalink)  
Old 04-12-2011, 12:54 PM
elesbb's Avatar
Super genious in training
Offline
Pocket PC: HTC Touch Pro 2
Carrier: Sprint
Threadstarter
Location: PA
 
Join Date: Jun 2010
Posts: 1,198
Reputation: 1600
elesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on rep
Mentioned: 42 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Quote:
Originally Posted by quick99si View Post
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()) !!
hmm , I have used message to display variable values , however , the amount of time until midnight was wrong , unless I used 24 .. maybe I'm doing something wrong ?
Reply With Quote
  #27 (permalink)  
Old 04-12-2011, 01:37 PM
quick99si's Avatar
Halfway to VIP Status
Offline
Pocket PC: Nexus S - E3GT - Epic 3G
Carrier: SERO $30
Location: Chicago, IL
 
Join Date: Dec 2007
Posts: 631
Reputation: 1245
quick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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
Reply With Quote
  #28 (permalink)  
Old 04-12-2011, 06:54 PM
elesbb's Avatar
Super genious in training
Offline
Pocket PC: HTC Touch Pro 2
Carrier: Sprint
Threadstarter
Location: PA
 
Join Date: Jun 2010
Posts: 1,198
Reputation: 1600
elesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on rep
Mentioned: 42 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

yes sir ! thanks so much for all your help !
Reply With Quote
Reply

  PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 03:06 AM.


Powered by vBulletin® ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com