Results 1 to 15 of 15
  1.    #1  
    Looking for the best way to triiger my script to run when I turn device on. Currently my scripts is set to sleep for 10 min.'s, if power turns off, it seems to start counting my sleep from the beginning. How to trigger this script to run at power-on, I dont want to stop the device from sleeping/turning off.

    Looked at a few other scripts that do this, but cant figure the "simple" code out.
  2. #2  
    Stick it in a endwhile loop at sleep 2000.When you power on device loop starts pushing your write.When you turn off device the loop goes into sleep untill your next power on.
    example,hehehe

    # NLED.mscr - Monitors notifications and turns on and off the notification LED accordingly.
    #

    # check dependencies
    If ( NOT FileExists( "\Windows\LEDUp.exe" ) )
    Message ( "Installation of LEDUp.exe is required! Exiting...", "NLED script" )
    Exit
    EndIf

    # initialize variables
    LedOn = FALSE
    Notify = FALSE

    # start notification check loop
    While ( 1 )

    # check the registry for any notifications
    Notify = RegValueExists( "HKLM", "System\State\Shell\Notifications\Active", "CLSID" )

    # turn on the led if any notifications are pending. Keep turning on each iteration since
    # the OS turns it off whenever there is a new notification.
    If ( Notify )
    RunWait( "\Windows\LEDUp.exe", "0 1" )
    LedOn = TRUE
    EndIf

    # turn off the led if no notifications are pending
    If ( LedOn && NOT Notify )
    RunWait( "\Windows\LEDUp.exe", "0 0" )
    LedOn = FALSE
    EndIf

    # wait 5 seconds
    Sleep( 5000 )

    EndWhile
    Last edited by slingbox; 06/03/2007 at 10:40 PM.
  3.    #3  
    I cant have my script run every 2 seconds while treo is ON. It needs to read every 10 minutes a remote log file. But when I turn power on, I would like it to start the script, and wait another 10 minutes or until next power-on.
  4. #4  
    The loop allows you to start the read.How you write determines the Push within the loop
  5.    #5  
    I dont understand...
    OK, what happens when your script is sleeping for 10 minutes. 3 minutes into the sleep you turn your phone off, where does you script start when power is turned on? Seems like it sleeps for the full time once again and wont run again until that time has fully expired.

    Just need it to run script from beginning when device is turned back on.
  6. #6  
    nothing your Treo is sleeping and seeing your on the 750 it,s in deep sleep so nothing is going to happen 10 min after you turn off device unless you want to set a timer script adding a toggle to wake device up to push reads && Writes.
  7. #7  
    inter the knowledge you seek is located in the Alert control.mscr file in TA.look for the xcast portion in the mscr file for many of your questions will be answered at a glance.
  8.    #8  
    Looked and looking again at xcast. TA is only .cab now - so last resort installing TA on my device to look at scripts.
  9. #9  
    Located in zip.
    For future refrence you can drag cab into notes and find scripts within.
    Attached Files Attached Files
  10.    #10  
    DID IT USING RunONPowerOn!!! As expected the RunONPowerOn function works along with a "PowerOn" script. No need to run all of your runat = time etc.

    This code does a nice and easy script run each time you power on your device, your device gets a call or system notification when sleeping/off, etc.

    USED RunONPowerOn (Adds to notifications queue):
    If ( PARAM eq "NOC Statistics" )
    RunOnPowerOn( SystemPath( "ScriptExe" ) \ "MortScript.exe", """" & SystemPath( "ScriptPath" ) \ "PowerOn.mscr" & """" )
    Endif

    Created the PowerON script:
    ### Stops MyToday Script, Waits, Runs script again.
    Sleep (2 * SECONDS)
    KillScript( Script )
    Sleep (5 * SECONDS)
    Run( MortScript, Quote & Script & Quote & " PARAM=" & Quote & PARAM & Quote )


    Changed my disable script adding code to remove any/all the notifications:
    If ( PARAM eq "Disable" )
    RemoveNotifications( MortScript )
    RemoveNotifications( Script )
    RemoveNotifications( ScriptPowerON )
    RegWriteString("HKLM", ITEM, "bmp", FOLDER \ "Web_Stop.bmp" )
    Exit
    Endif
    Last edited by Interstink; 06/04/2007 at 10:51 AM.
  11. #11  
    good job..Question though.Didnt you want the script to run every 10 min after you power on
    Last edited by slingbox; 06/04/2007 at 12:13 PM.
  12.    #12  
    Quote Originally Posted by slingbox View Post
    good job..Question though.Didnt you want the script to run every 10 min after you power on
    Yes, It does do that as well. The main functions of the script still wait/sleeps ten minutes as long as the phone is on. That 10 minutes is the SOONEST I want it to check the logs while phone is on.
    (My logs (MRTG Logs - http://oss.oetiker.ch/mrtg/) update on the server every 5 minutes). NOTE: MRTG is used by a lot Network Operations Centers along with other statistics monitors.

    But since my phone often goes to sleep before ten minutes (When left unattended), I also wanted my today plugin to do an update when I turn it on.

    When phone is turned on:
    1. Runs my poweron script (Since the normal script is running still, I had to kill it, and run it again)
    2. Then normal script runs and waits ten minutes. If phone stays on it will update information every ten minutes or until phone turns off.

    SLEEP Function: Seems sleep should have more options. SleepUntilPoweroff, SleepUntilPowerOn, etc...
  13. #13  
    good job
  14.    #14  
    Can TA wake device from "Deep Sleep"?
  15. #15  
    yes

Posting Permissions