File: random_location.ssc

package info (click to toggle)
stellarium 25.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,307,224 kB
  • sloc: ansic: 317,377; cpp: 214,435; xml: 48,592; javascript: 26,073; python: 2,113; perl: 734; sh: 247; makefile: 192; pascal: 169
file content (28 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// Name: Random location
// Author: Alexander Wolf
// Shortcut: Ctrl+D,L
// License: Public Domain
// Version: 1.0
// Description: This script will help you make practical works for celestial navigation - he sets a random location and hides it from the GUI.
//

function randomFloat(min, max) {
    return min + (max - min) * Math.random();
}

if (core.isModuleLoaded("Satellites"))
{
    if (Satellites.getFlagHintsVisible()) {
        Satellites.setFlagHintsVisible(false);
    }
}
if (core.isModuleLoaded("NavStars"))
{
    if (!NavStars.getNavStarsMarks()) {
        NavStars.setNavStarsMarks(true);
    }
}
core.wait(0.5);
core.setObserverLocation(randomFloat(-180., 180.), randomFloat(-90., 90.), 1., 1., "unknown location", "Earth");
core.wait(1.);