Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin run 8fKCR6Eh
- if not fs.exists("/startup") then
- term.clear()
- term.setCursorPos(1,2)
- print("No startup found.")
- print("Checking for existing GPS server...")
- supX, supY, supZ = gps.locate(1)
- if supX == nil then
- print("Enter X:")
- write(">")
- repeat
- newX = tonumber(read())
- until newX ~= nil
- print("Enter Y:")
- write(">")
- repeat
- newY = tonumber(read())
- until newY ~= nil
- print("Enter Z:")
- write(">")
- repeat
- newZ = tonumber(read())
- until newZ ~= nil
- else
- print("Oh good, one was found.")
- newX = supX
- newY = supY
- newZ = supZ
- end
- print("Setting up GPS server...")
- file = fs.open("/startup", "w")
- file.writeLine("shell.run('gps host " .. newX .. " " .. newY .. " " .. newZ .. "')")
- file.close()
- os.reboot()
- else
- print("Startup already exists. Cancel.")
- end
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement