Results 1 to 6 of 6
  1.    #1  
    i know this is used for installing apps on sd cards or main memory. i have copied it and used it on a few of my personal scripts. i am having trouble with a script i am writing now and i think it has to do with me not understanding these two. can someone please explain the difference and how and when i would use one over the other? i noticed sometimes other people scripts dont use the instPath one and just use the msPath.

    thanks, cody

    ps: i did search first and just got confused. lol.


    Code:
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # Make sure there is a MortScript.exe on the device for this app
    # even if installing to the storage card
    If ( Find( instPath, "\Storage Card" ) = 1 )
       msPath = SubStr( instPath, 14 )
       If ( NOT DirExists( msPath ) )
          MkDir( msPath )
       EndIf
       Copy( instPath \ "MortScript.exe", msPath \ "MortScript.exe", 1 )
    Else
       msPath = instPath
    EndIf
    
    # Get my path
    myPath = SystemPath( "ScriptPath" )
  2.    #2  
    this is the script i am tring to use it with. it is running my profile scripts at set times. if anyone wants to re write it thay can.

    you will see where i remove the notifications i have to do it a little different. this is not my big problem. my problem is the notifications never get wrote to the notification que.

    you will also see that the "currentday" is used so that it wont set profile to work on the weekends. i dont work weekends. lol

    thanks agian, cody


    Code:
    #runner.mscr - switches scripts on at set times 5, 8, 16, 18, 22
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # Make sure there is a MortScript.exe on the device for this app
    # even if installing to the storage card
    If ( Find( instPath, "\Storage Card" ) = 1 )
       msPath = SubStr( instPath, 14 )
       If ( NOT DirExists( msPath ) )
          MkDir( msPath )
       EndIf
       Copy( instPath \ "MortScript.exe", msPath \ "MortScript.exe", 1 )
    Else
       msPath = instPath
    EndIf
    
    # Get my path
    myPath = SystemPath( "ScriptPath" )
    
    sleep (15000)
    
    #remove old notification queues
    # i have to remove them like this because it's the only way it works. this is not my problem though.
    #work on this part later. works for now.
    
    RemoveNotifications ("\Program Files\Profile X\Wake.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Work.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Sleep.mscr" )
    RemoveNotifications ("\Program Files\Profile X\runner.mscr" )
    
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Wake.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Profile Work.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Sleep.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\runner.mscr" )
    
    Sleep (15000)
    
    # initialize variables
    CurrentHour = 0
    CurrentMinute = 0
    CurrentSecond = 0
    CurrentDay = 0
    CurrentMonth = 0
    CurrentYear = 0
    
    #Figure out what year, month, and day it is
    GetTime ( CurrentHour, CurrentMinute, CurrentSecond, CurrentDay, CurrentMonth, CurrentYear )
    
    
    ##############sunday###################
    If (CurrentHour < 5 && CurrentDay = 0)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    If ((CurrentHour >= 5 && CurrentDay = 0) AND (CurrentHour < 16 && CurrentDay = 0))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 0) AND (CurrentHour < 22 && CurrentDay = 0))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 0) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############monday###################
    If (CurrentHour < 5 && CurrentDay = 1)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 1) AND (CurrentHour < 8 && CurrentDay = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDay = 1) AND (CurrentHour < 16 && CurrentDay = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 1) AND (CurrentHour < 22 && CurrentDay = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 1) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############tuesday###################
    If (CurrentHour < 5 && CurrentDay = 2)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 2) AND (CurrentHour < 8 && CurrentDay = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDay = 2) AND (CurrentHour < 16 && CurrentDay = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 2) AND (CurrentHour < 22 && CurrentDay = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 2) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############wednesday###################
    If (CurrentHour < 5 && CurrentDay = 3)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 3) AND (CurrentHour < 8 && CurrentDay = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDay = 3) AND (CurrentHour < 16 && CurrentDay = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 3) AND (CurrentHour < 22 && CurrentDay = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 3) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############thursday###################
    If (CurrentHour < 5 && CurrentDay = 4)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 4) AND (CurrentHour < 8 && CurrentDay = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDay = 4) AND (CurrentHour < 16 && CurrentDay = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 4) AND (CurrentHour < 22 && CurrentDay = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 4) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############friday###################
    If (CurrentHour < 5 && CurrentDay = 5)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 5) AND (CurrentHour < 8 && CurrentDay = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDay = 5) AND (CurrentHour < 16 && CurrentDay = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 5) AND (CurrentHour < 22 && CurrentDay = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 5) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############saturday###################
    If (CurrentHour < 5 && CurrentDay = 6)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDay = 6) AND (CurrentHour < 16 && CurrentDay = 6))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDay = 6) AND (CurrentHour < 22 && CurrentDay = 6))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 22 && CurrentDay = 6) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    Last edited by codyppc; 07/23/2007 at 12:49 PM.
  3.    #3  
    ok, after 20 hours i have figured it out. i made a little script to run as a test...


    Code:
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentHour",%CurrentHour%
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentMinute",%CurrentMinute%
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentSecond",%CurrentSecond%
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentDay",%CurrentDay%
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentMonth",%CurrentMonth%
    RegWriteString "HKLM", "Software\Mort's MortScript\runner", "CurrentYear",%CurrentYear%
    i found out that "CurrentDay" is not CurrentDay of the week, but CurrentDay of the month.

    this was added to make it work.

    Code:
    CurrentDayOfWeek = FormatTime( "w" )
    and the final script looks like this....

    Code:
    #my runner.mscr - switches scripts on at set times 5, 8, 16, 18, 22
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # Make sure there is a MortScript.exe on the device for this app
    # even if installing to the storage card
    If ( Find( instPath, "\Storage Card" ) = 1 )
       msPath = SubStr( instPath, 14 )
       If ( NOT DirExists( msPath ) )
          MkDir( msPath )
       EndIf
       Copy( instPath \ "MortScript.exe", msPath \ "MortScript.exe", 1 )
    Else
       msPath = instPath
    EndIf
    
    # Get my path
    myPath = SystemPath( "ScriptPath" )
    
    sleep (15000)
    
    #remove old notification queues
    # i have to remove them like this because it's the only way it works. this is not my problem though.
    #work on this part later. works for now.
    
    RemoveNotifications ("\Program Files\Profile X\Wake.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Work.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Sleep.mscr" )
    RemoveNotifications ("\Program Files\Profile X\runner.mscr" )
    
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Wake.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Profile Work.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\Sleep.mscr" )
    RemoveNotifications ("\Storage Card\Program Files\Profile X\runner.mscr" )
    
    Sleep (15000)
    
    # initialize variables
    CurrentHour = 0
    CurrentMinute = 0
    CurrentSecond = 0
    CurrentDay = 0
    CurrentMonth = 0
    CurrentYear = 0
    CurrentDayOfWeek = 9
    
    #Figure out what year, month, and day it is
    GetTime ( CurrentHour, CurrentMinute, CurrentSecond, CurrentDay, CurrentMonth, CurrentYear )
    CurrentDayOfWeek = FormatTime( "w" )
    
    ##############sunday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 0)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 0) AND (CurrentHour < 16 && CurrentDayOfWeek = 0))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 0) AND (CurrentHour < 22 && CurrentDayOfWeek = 0))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 0) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############monday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 1)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 1) AND (CurrentHour < 8 && CurrentDayOfWeek = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDayOfWeek = 1) AND (CurrentHour < 16 && CurrentDayOfWeek = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 1) AND (CurrentHour < 22 && CurrentDayOfWeek = 1))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 1) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############tuesday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 2)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 2) AND (CurrentHour < 8 && CurrentDayOfWeek = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDayOfWeek = 2) AND (CurrentHour < 16 && CurrentDayOfWeek = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 2) AND (CurrentHour < 22 && CurrentDayOfWeek = 2))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 2) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############wednesday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 3)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 3) AND (CurrentHour < 8 && CurrentDayOfWeek = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDayOfWeek = 3) AND (CurrentHour < 16 && CurrentDayOfWeek = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 3) AND (CurrentHour < 22 && CurrentDayOfWeek = 3))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 3) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############thursday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 4)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 4) AND (CurrentHour < 8 && CurrentDayOfWeek = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDayOfWeek = 4) AND (CurrentHour < 16 && CurrentDayOfWeek = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 4) AND (CurrentHour < 22 && CurrentDayOfWeek = 4))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 4) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############friday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 5)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 5) AND (CurrentHour < 8 && CurrentDayOfWeek = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8 && CurrentDayOfWeek = 5) AND (CurrentHour < 16 && CurrentDayOfWeek = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 5) AND (CurrentHour < 22 && CurrentDayOfWeek = 5))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 5) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    
    ##############saturday###################
    If (CurrentHour < 5 && CurrentDayOfWeek = 6)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, msPath \ "MortScript.exe", """" & instPath \ "Wake.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5 && CurrentDayOfWeek = 6) AND (CurrentHour < 16 && CurrentDayOfWeek = 6))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, msPath \ "MortScript.exe", """" & instPath \ "Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16 && CurrentDayOfWeek = 6) AND (CurrentHour < 22 && CurrentDayOfWeek = 6))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, msPath \ "MortScript.exe", """" & instPath \ "Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22 && CurrentDayOfWeek = 6) 
    Rerun = Timestamp()+7201
    RunAt( Rerun, msPath \ "MortScript.exe", """" & instPath \ "runner.mscr" )
    EndIf
    i still would like to know more about instPath and msPath.

    thanks, cody
  4. #4  
    Cody, instPath and msPath are just variables I use in TA install.mscr. Read the comments in the script. Basically instPath is the cab's installation path where all of the scripts are installed to. This can be on the device or storage card. MortScript.exe must be installed to the device however to work properly wihen you expect scripts to be run from the startup folder or notification queue so I have the install script copy it to the device if needed. So msPath is the path to MortScript and it's always going to point to a path on the device.

    Does that explain it adequately?
  5.    #5  
    is see. so msPath stands for mortscript path.

    make total since.

    thanks, cody

    thread closed. lol
  6. #6  
    No No Dont Close This Thread Codeman Lol Lol

Posting Permissions