Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GenBoot.ks v0.2.0
- // Generic Boot script
- // Author - Scarlet-Laura
- set ship:control:pilotmainthrottle to 0.
- function NOTIFY {
- parameter message.
- HUDTEXT("kOS: " + message, 5, 2, 50, WHITE, false).
- }
- NOTIFY("SYSTEM BOOT IN PROGRESS...").
- // File manager starts here
- // Detect existance of file of intrest
- function hasFile {
- parameter name. // Name of file of intrest
- parameter vol. // Volume to search
- switch to vol.
- list files in allFiles.
- for file in allFiles {
- if file:name = name {
- switch to 1.
- print "We Have It". // debug test - doesn't print
- wait 5.
- return true.
- }
- }
- switch to 1.
- return false.
- }
- // Get file from KSC - seems inoprable when called
- function download {
- parameter name.
- if hasFile(name, 1) {
- deletepath("1:/name").
- }
- if hasFile(name, 0) {
- copypath("0:/name", "1:/").
- }
- }
- // Send file to KSC
- function upload {
- parameter name.
- if hasFile(name, 0) {
- switch to 0.
- deletepath("0:/name").
- switch to 1.
- }
- if hasFile(name, 1) {
- copypath("1:/name", "0:/").
- }
- }
- // Actual Bootup Process
- set updateScript to ship:name + "update.ks". // syntax works on its own
- // check for and run new instructions - Doesn't trigger any error, but seems nonfunctional
- if hasFile(updateScript, 0) {
- copypath("0:/updateScript", "1:/"). // Tested manualy, seems to work
- switch to 0.
- deletepath("0:/updateScript").
- switch to 1.
- runpath("1:/updateScript").
- }
- // If startup.ks file exists onboard, run that - Script appears to fall straight to here and
- // follow the 10 second reboot
- set startup to ship:name + "startup.ks".
- if hasFile(startup, 1) {
- runpath("1:/startup").
- }
- else {
- wait 10.
- reboot.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement