Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w, h = term.getSize()
- function printCentered(text, y)
- term.setCursorPos(w/2 - #text/2, y)
- term.write(text)
- end
- term.clear()
- term.setCursorPos(1,1)
- print(string.rep("-", w))
- printCentered("Welcome to the GraviMail server wizard.", 2)
- printCentered("This will lead you through", 3)
- printCentered("installing the GraviMail server.", 4)
- print(string.rep("-", w))
- os.sleep(0.5)
- print("\n")
- print("Which side is your modem on?")
- print("[top, bottom, back, front, left, right]")
- local side = read()
- print("Modem at side: "..side)
- os.sleep(0.5)
- function askForMaster()
- print("What is the master server ID?")
- local master = read()
- if not tonumber(master) then
- print("Master ID not a number.")
- os.sleep(0.2)
- askForMaster()
- else
- return master
- end
- end
- local master = askForMaster()
- os.sleep(0.5)
- print("Creating preference file...")
- os.sleep(0.2)
- file = fs.open("gravimail/server/pref", "w")
- file.write(textutils.serialise({side=side,master=master}))
- file.close()
- print("Preference file created in gravimail/server/pref. Do not delete this file!")
- os.sleep(0.5)
- print("Removing old startup files...")
- if fs.exists("startup") then
- fs.delete("startup")
- end
- print("Downloading GraviMail server files...")
- shell.run("pastebin","get","https://pastebin.com/4cEztaWS","startup")
- os.sleep(0.5)
- print("Rebooting...")
- os.sleep(0.5)
- os.reboot()
Add Comment
Please, Sign In to add comment