Results 1 to 4 of 4
  1.    #1  
    i have a script like this...

    Code:
    # runner.mscr - switches scripts on at set times 5, 8, 16, 18, 22
    
    sleep (30000)
    
    
    # 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 )
    
    If (CurrentHour < 5)
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 5, 0, "\Program Files\Profile X\Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, "\Program Files\Profile X\Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, "\Program Files\Profile X\Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 18, 0, "\Program Files\Profile X\kl on.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, "\Program Files\Profile X\Sleep.mscr" )
    Rerun = Timestamp()+86401
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 5) AND (CurrentHour < 8))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 8, 0, "\Program Files\Profile X\Profile Work.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, "\Program Files\Profile X\Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 18, 0, "\Program Files\Profile X\kl on.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, "\Program Files\Profile X\Sleep.mscr" )
    Rerun = Timestamp()+68401
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 8) AND (CurrentHour < 16))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 16, 0, "\Program Files\Profile X\Profile Home.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 18, 0, "\Program Files\Profile X\kl on.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, "\Program Files\Profile X\Sleep.mscr" )
    Rerun = Timestamp()+57601
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 16) AND (CurrentHour < 18))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 18, 0, "\Program Files\Profile X\kl on.mscr" )
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, "\Program Files\Profile X\Sleep.mscr" )
    Rerun = Timestamp()+28801
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    
    If ((CurrentHour >= 18) AND (CurrentHour < 22))
    RunAt( CurrentYear, CurrentMonth, CurrentDay, 22, 0, "\Program Files\Profile X\Sleep.mscr" )
    Rerun = Timestamp()+21601
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    
    If (CurrentHour >= 22)
    Rerun = Timestamp()+7201
    RunAt( Rerun, "\Program Files\Profile X\runner.mscr" )
    EndIf
    my problem is with ever change of barrety or softreset i start getting duplicate notifications in my notification queue.

    in the mort manual 9.5.7 is talks about removing these notification queues, but doesn't give a good example. can some one tell me how to write that part?

    this is what i have tried that doesn't work...

    #RemoveNotifications.mscr

    Code:
    RemoveNotifications ("\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Work.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Profile Home.mscr" )
    RemoveNotifications ("\Program Files\Profile X\kl on.mscr" )
    RemoveNotifications ("\Program Files\Profile X\Sleep.mscr" )
    thanks for any help, cody
  2. #2  
    Cody, as near as I can tell, that code is correct. So maybe a problem with the version of MortScript you are using?

    I would create two simple test scripts, one that just does a RunAt() and one that does a Removenotifications(). Cleanup the queue first. Whenever I had issues before, I would go back and do that simple test and it always seemed to work. If the strings don't match exactly though, it will fail.
  3.    #3  
    ok, it works. it seems that if I have memmaid reading the notification queue's still opened in the backgroung then the script won't remove them. otherwise it works just fine.

    thanks zbop.
    Last edited by codyppc; 06/03/2007 at 09:35 PM.
  4. #4  
    Quote Originally Posted by codyppc View Post
    ok, it works. it seems that if I have memmaid reading the notification queue's still opened in the backgroung then the script won't remove them. otherwise it works just fine.

    thanks zbop.
    Trippin over yourself, heh. Yeah I've done that

    Makes sense now...

Posting Permissions