Setting TimeRate to something other than 100 1000 etc.

All about writing scripts for Celestia in Lua and the .cel system
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 6 months
Location: Colorado, USA (7000 ft)

Setting TimeRate to something other than 100 1000 etc.

Post #1by don » 04.08.2003, 15:01

How do I set the Time Rate to something other than 1x 100x 1000x, etc.?

The script below will set Celestia's Time Rate to 5x.

* Copy the text in the Code box
* Paste it into your texty editor
* Edit the "rate" value of "5.0" to be the Time Rate you want
* Save the file as "SetTimeRate.cel" into the Celestia directory
* Double click the filename -or- use Celestia's File/Open Script dialog to run it

If you double-click a .cel filename, Celestia will run that script. If Celestia is not currently running, it will be run automatically.

Code: Select all

{
#****************************************************************************
#*                 This Celestia Script Sets the Time Rate                  *
#****************************************************************************

# Set Time Rate (1x, 5x, 100x, 1000x, etc.)...
# (A negative value = Reverse time
#               1.0 = Real Time (default)
#            1000.0 = Good moon orbit motion)
    timerate { rate 5.0 }

#----------------------------------------------------------------------------
# End of Script - Let the user know the script is done running ...
#----------------------------------------------------------------------------

    print  { text "The script is finished."
             row  -2
             column 25
             duration 5 }

    wait   { duration 5 }

}
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Return to “Scripting”