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
  #1 (permalink)  
Old 04-10-2011, 10:07 AM
elesbb's Avatar
Super genious in training
Offline
Pocket PC: HTC Touch Pro 2
Carrier: Sprint
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)
Certain script run at a certain time

What i want to do is RUn a script at midnight every night . How can i do this ?

I was looking through the MortScript manual and found a command named "RunAt" but was very confused as to the formating and syntax of this command . Im just confused as to how this command works . any examples from those who better understand mortscript would be appreciated

I personally would like HELP as to accomplish this rather than someone doing it for me , i want to better learn and understand mortscript.

THANKS GUYS !!
Reply With Quote
  #2 (permalink)  
Old 04-10-2011, 10:25 AM
PPCFreak's Avatar
Almost a VIP
Offline
Pocket PC: HTC TP2
Carrier: Verizon
Location: Midwest US
 
Join Date: Feb 2007
Posts: 948
Reputation: 1271
PPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on repPPCFreak is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Wirelessly posted (VZW TP2: Opera/9.7 (WindowsMobile; PPC; Opera Mobi/35267; U; en; Presto/2.1.1))

wrong section
Will get better response if this was in the main threads....
That said, what are you looking for on Mortscript?
RunAt has a date and time parameters. look online for mortscript manual. It has samples for RunAt and all the other commands in Mortscript.
__________________
TP2 CDMA HSPL Unlocker is here
Don't Forget to Say 'Thanks'.

NRGz Wiki/FAQ Here
NRGz 29022 Sense 2.5 CHT1.8.5 Jul 4th
Reply With Quote
  #3 (permalink)  
Old 04-10-2011, 11:14 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

I just noticed I posted in the wrong section . I forgot I was in the rom section when I posted . I just wasn't paying attention . I already have the MortScript manual . I just don't completely understand the formats used for the date and time functions .
Reply With Quote
  #4 (permalink)  
Old 04-10-2011, 12:24 PM
darren.wlsn1's Avatar
acs tester
Offline
Pocket PC: diamond/tp1/tp2/MoFo/touch 4g
Carrier: ppcgeeks/sprint
Location: pa
 
Join Date: May 2008
Posts: 24,870
Reputation: 51195
darren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation level
Mentioned: 14 Post(s)
Tagged: 0 Thread(s)
Send a message via AIM to darren.wlsn1 Send a message via MSN to darren.wlsn1 Send a message via Yahoo to darren.wlsn1 Send a message via Skype™ to darren.wlsn1
Re: Certain script run at a certain time

moved..
Reply With Quote
This post has been thanked 1 times.
  #5 (permalink)  
Old 04-10-2011, 01:45 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 darren.wlsn1 View Post
moved..
thank you . I had a brain fart this morning and wasn't paying attention .
Reply With Quote
  #6 (permalink)  
Old 04-10-2011, 07:04 PM
darren.wlsn1's Avatar
acs tester
Offline
Pocket PC: diamond/tp1/tp2/MoFo/touch 4g
Carrier: ppcgeeks/sprint
Location: pa
 
Join Date: May 2008
Posts: 24,870
Reputation: 51195
darren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation leveldarren.wlsn1 can't get a higher reputation level
Mentioned: 14 Post(s)
Tagged: 0 Thread(s)
Send a message via AIM to darren.wlsn1 Send a message via MSN to darren.wlsn1 Send a message via Yahoo to darren.wlsn1 Send a message via Skype™ to darren.wlsn1
Quote:
Originally Posted by elesbb View Post
thank you . I had a brain fart this morning and wasn't paying attention .
Not a problem.

Sent from my SPH-D700 using Tapatalk
Reply With Quote
  #7 (permalink)  
Old 04-10-2011, 08:34 PM
mwalt2's Avatar
VIP Member
Offline
Pocket PC: Evo 3D
Carrier: Sprint
 
Join Date: Apr 2007
Posts: 1,759
Reputation: 5415
mwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the communitymwalt2 is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Search and ask in the thread below. I don't know the answer, but I'm sure it can probably be done.

MortScript examples accumulation - xda-developers
Reply With Quote
  #8 (permalink)  
Old 04-10-2011, 09:52 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 mwalt2 View Post
Search and ask in the thread below. I don't know the answer, but I'm sure it can probably be done.

MortScript examples accumulation - xda-developers
I'm pretty sure its possible . I've been on that thread more than I'm in my own underwear . its helpful , but a lot of the examples are old style code . but thank you ! I'll dig around in there ! *gets shovel*
Reply With Quote
  #9 (permalink)  
Old 04-10-2011, 11:43 PM
NinjaDuck's Avatar
VIP Duck
Offline
Pocket PC: RAPHAEL / TOPAZ / RHODIUM
Carrier: Verizon
Location: Omnipresent
 
Join Date: Feb 2009
Posts: 825
Reputation: 6270
NinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Quote:
Originally Posted by elesbb View Post
What i want to do is RUn a script at midnight every night . How can i do this ?

I was looking through the MortScript manual and found a command named "RunAt" but was very confused as to the formating and syntax of this command . Im just confused as to how this command works . any examples from those who better understand mortscript would be appreciated

I personally would like HELP as to accomplish this rather than someone doing it for me , i want to better learn and understand mortscript.

THANKS GUYS !!
GAlarm - is a great alarm clock and also lets you schedule programs to run instead of alarms. Well worth the $$.
__________________
Some requests I have filled: Click Here
Reply With Quote
  #10 (permalink)  
Old 04-11-2011, 06:36 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

Forget taking it elsewhere, we can solve it here

I know you said you just wanted help and not a solution, but first, I'm assuming you've referred to the *complete* manual? You can download it in HTML for viewing on your phone, use this clickable PDF: http://www.sto-helit.de/downloads/mo...ipt-Manual.pdf, etc..

For your scheduling needs, you can would make the notification from within the script that is being scheduled. Before doing this, I advise removing the script from the Windows notifications queue first using the following command:

Code:
RemoveNotifications(applications, parameter)
For application, you'll reference MortScript.exe (full path), and for the parameter, you will need the full path and filename of your script in quotes. SystemPath() is used for both. That command ensures that you won't leave duplicates in the queue.

As far as scheduling the execution, it's not as straightforward and frankly, I'm still thinking of the most elegant way myself. My elementary instict was to do something like:

Code:
GetTime(varTmp,varTmp,varTmp,varDay,varMonth,varYear)
varSelf=SystemPath("ScriptPath") + SystemPath("ScriptName") + SystemPath("ScriptExt") +
RunAt(varYear,varMonth,varDay+1,"0","01",varSelf)
But the problem arises with the day+1 computation... it won't work all that well on April 30th trying to schedule itself for 04-31-2011 00:01, then 4-32, 4-33, etc... You would need to use some if statements but it gets ugly with the different number of days or different months, and so on.

The way around this is to use Unix timestamp and time formatting.

Code:
9.11.2  Formatted output (FormatTime)
string = FormatTime( format [, timestamp ] )
Returns the time of the timestamp, or the current time if none is given, formatted corresponding to 
the format string.
These characters will be replaced with the corresponding value:
H Hour (00-23)
h Hour (01-12)
a am/pm
A AM/PM
i Minute (00-59)
s Seconds (00-59)
d Day (01-31)
m Month (01-12)
Y Year (4 digits)
y Year (2 digits)
w Day of week (0=Sunday to 6=Saturday)
u Unix timestamp
{MM}Month name (e.g. “January”)
{M} Month name abbreviated (e.g. “Jan”)
{WW}Day of week name (e.g. “Monday”)
{W} Day of week name abbreviated (e.g. “Mon”)
All other characters remain unchanged.
Note all return values will be strings. This is to allow leading zeroes, like "02" for february, which 
is handy to combine filenames. However, it might cause troubles when using arrays. You either 
need to assign the array elements with strings (“Month["01"] = "First"”) or convert the string to a 
number, e.g. by using “FormatTime("m")*1”.
Examples:
x = FormatTime( "h:i:s a" )
x = FormatTime( "m/d/Y", TimeStamp() + 86400 )
The last line adds exactly 24hours to the current time and returns it in "04/12/2011" format. That's a bit useless to you since you'd have to parse it further. Instead, I would advise passing "u" as the format and then using that value with RunAt() for scheduling the next execution.
Code:
9.6.5  Execute application at a given time (RunAt):
RunAt( Unix timestamp, application [, parameter] )
Again, application is the Mortscript EXE and parameter is your script in quotes. The only concern I have is that if you keep rescheduling the script for 24hrs in the future, you may start seeing time added due to delays in the event that your phone is off at that time and the script is execute 6hrs late or something. Therefore, the unix timesamp() + 24hrs thing is only effective for extracting the date of the next day (not the time).

So the final hurdle involves getting tomorrow's time in Unix format, converting that time to a regular time format, changing that new time to 00:01 while leaving the d/m/y intact, change it back to Unix, and then pass that value to RunAt().

There are a couple of different ways of doing it, I'll post mine when I sit down and get my script finalized. I'd like to see what you come up with as well.
Reply With Quote
This post has been thanked 1 times.
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 07:31 AM.


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