Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Prompt user to insert a disk into the device
- print("Please insert a disk into the device and press Enter.")
- while not disk.isPresent("back") do
- os.pullEvent("disk")
- end
- -- Download prhVcdAv from pastebin as startup in the root directory
- local startupCode = "prhVcdAv"
- local startupPath = "/startup"
- shell.run("pastebin", "get", startupCode, startupPath)
- -- Once disk is inserted, create a directory /disk/Cards/ if it doesn't exist
- local cardsDir = "/disk/Cards"
- if not fs.exists(cardsDir) then
- fs.makeDir(cardsDir)
- end
- -- Prompt user to insert an override card into the bottom drive and press Enter.
- print("Please insert an override card into the bottom drive and press Enter.")
- while not disk.isPresent("bottom") do
- os.pullEvent("disk")
- end
- -- Download n5Mx91gK as /disk/touch.lua
- local touchCode = "n5Mx91gK"
- local touchPath = "/disk/touch.lua"
- shell.run("pastebin", "get", touchCode, touchPath)
- -- Run touch.lua on the right monitor
- local monitorSide = "right"
- if peripheral.isPresent(monitorSide) and peripheral.getType(monitorSide) == "monitor" then
- shell.run(touchPath)
- else
- print("No monitor found on the right side.")
- end
- -- Get the ID of the inserted disk
- local diskID = disk.getID("bottom")
- local diskName = tostring(diskID)
- -- Save the disk ID as a file in /disk/ with the name as the disk's ID
- local diskFilePath = "/disk/" .. diskName
- local file = fs.open(diskFilePath, "w")
- file.writeLine(diskName)
- file.close()
- print("Setup complete.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement