-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunScience.ks
More file actions
56 lines (50 loc) · 2.47 KB
/
RunScience.ks
File metadata and controls
56 lines (50 loc) · 2.47 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//This script is used to make it easier to quickly run science experiments and crew reports,store the
//science in an "Experiment Storage Unit" (ESU) and reset the experiements. Clearing all science is
//useful if you have already run the experiment and have stored the science in the ESU. "Collecting
//all science" will not store duplicate science data, and for Science Bays and Goo Canisters it will
//reset them so they can be run again. It will delete science data on experiments that can be
//repeatedly run, like thermometers. This allows you to repeatedly press 1-2-3 to quickly run all
//science experiments and gather all the data. I use this script while descending through an
//atmosphere so I can quickly get all the sceince at different altitudes and bioms. I don't have to
//click on each part or check to see if I've already got the data before running a goo or science bay.
//Requirements - must have "Standard_Lib.ks" file in the same directory
// - For option #2 to function, an Experiment Storage Unit part (ESU or "Science Box") on
// the ship. The program will inform you of this. Options 1 and 3 will still function
run Standard_Lib.ks.
Declare sensorlist to GetSensorList().
Declare UserChoice to "none".
Declare ESUList to GetESUlist().
Declare Done is False.
function ResetScreen{
Clearscreen.
print ("Select an option: ") at(0,1).
print ("1: Run all science experiments") at(5,2).
print ("2: Collect all science") at(5,3).
print ("3: Clear all science experiments") at(5,4).
print ("4: End program") at(5,5).
print (" ") at(0,7).
}.
ResetScreen().
until Done {
set UserChoice to GetUserInput().
if UserChoice = 1 {
ResetScreen().
GetAllScience(sensorlist, False).
print("Conducted " + sensorlist:length + " science experiments") at(0,7).
} else if UserChoice = 2 {
if ESUList:length = 0 {
ResetScreen().
print("No ESU on this ship, no data stored.") at(0,7).
} else {
ESUList[0]:GETMODULE("ModuleScienceContainer"):doaction("collect all", true).
ResetScreen().
print("Collected all available science") at(0,7).
}
} else if UserChoice = 3 {
ResetScreen().
print ("Reset " + ClearAllScience(sensorlist) + " experiments") at(0,7).
} else if UserChoice = 4 {
set Done to True.
}
}.
Clearscreen.