Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local term = require("term")
- local fs = require("filesystem")
- local sh = require("shell")
- local forceinstallation = false
- local pastebincode = "vShCR471"
- --# with term.read, I got things like "input\n" so i fix this problem until they fix themselves
- function c(str)
- if component.isAvailable(str) then
- return true
- else
- return false
- end
- end
- function mkdir(foldername)
- fs.makeDirectory(foldername)
- end
- local args, _ = sh.parse(...)
- local arg = table.concat(args)
- local forceinstallation = arg == "force"
- if (c("screen") and c("inventory_controller") and c("keyboard") and c("modem") and c("internet")) or forceinstallation then
- print("Your computer seems ready. Have you installed OpenOS on your robot's hard disk ? [Y/n] ")
- r = term.read()
- if r == "n\n" or r == "N\n" then
- print("Once the installation finished, reboot your computer and relaunch the setup by 'pastebin run " .. pastebincode .. "'.")
- os.execute("install")
- os.reboot()
- end
- print("Proceed to the installation ? [Y/n]")
- r = term.read()
- if r == "y\n" or r == "Y\n" then
- mkdir("/home/oclib")
- mkdir("/home/oclib/builder")
- mkdir("/home/oclib/builder/models")
- mkdir("/usr/objectstore")
- --# os.execute("cd /home/oclib") --# Useless
- os.setenv("PWD", "/home/oclib")
- os.execute("wget https://raw.githubusercontent.com/InfinitiesLoop/oclib/8273255478f9b3b1a77e36a4fdbda8744ba9a569/init.lua")
- os.execute("wget https://raw.githubusercontent.com/InfinitiesLoop/oclib/master/init.files")
- print("Launching the installation program")
- dofile("init.lua")
- os.execute("wget https://gist.githubusercontent.com/Fingercomp/6563c64d70a4472f26923f78d77caeb9/raw/aa4f461ddee2af70a8040065be8974069e240e27/crash.lua")
- os.setenv("PWD", "/home")
- os.execute("pastebin get YErPe1FF build")
- print()
- print("Installation complete! (maybe)")
- else
- print("You can run again the installer by using 'pastebin run " .. pastebincode .. "'.")
- end
- else
- --# os.execute("resolution 50 16") Not useful
- print("Check if your robot have all these components:")
- print("- Disk Drive")
- print("- Upgrade Container (Tier 1)")
- print("- Upgrade Container (Tier 2)")
- print("- Hover Upgrade (Tier 2)")
- print("- Angel Upgrade")
- print("- Inventory Controller Upgrade")
- print("- Inventory Upgrade")
- print("- Network Card")
- print("- Internet Card")
- print("- Central Processing Unit (Tier 3)")
- print("- Memory (Tier 3.5) 2x")
- print("- Hard Disk Drive (Tier 3)")
- end
Add Comment
Please, Sign In to add comment