Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local System = os -- Used for System things like os.time() to System.time()
- local Screen = term -- Used for Screen thing on the turtle or computer like term.clear() to Screen.clear()
- local Per = peripheral -- Used shortcut for peripheral
- local Text = textutils -- Used shortcut for textilils
- local Pack = Text.serialize -- Makes a new command for packing ( shortcut used from local Text)
- local UnPack = Text.unserialize -- Makes a new command for unpacking ( shortcut used from local Text)
- local file = fs.exists("/API/Logo.lua")
- local file0 = fs.exists("/API/Functions.lua")
- local Monitor = {}
- Monitor[0] = Screen
- if not(file) then
- shell.run("pastebin get s3aBGUVr /API/Logo.lua")
- Monitor[0].clear()
- Monitor[0].setCursorPos(1,1)
- end
- if not(file0) then
- shell.run("pastebin get sujHjqXC /API/Functions.lua")
- Monitor[0].clear()
- Monitor[0].setCursorPos(1,1)
- end
- System.loadAPI("/API/Logo.lua")
- System.loadAPI("/API/Functions.lua")
- local w, h = Monitor[0].getSize()
- Monitor[0].clear()
- Logo.drawLogo(Monitor[0], "Head", math.floor(w/2)-6, math.floor(h/2)-4)
- local Disk
- local DiskName
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.white, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" Finding Disks ")) /2), (h-1))
- print(" Finding Disks ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- for i = 1,6 do
- local side
- if i == 1 then
- side = "back"
- elseif i == 2 then
- side = "front"
- elseif i == 3 then
- side = "left"
- elseif i == 4 then
- side = "right"
- elseif i == 5 then
- side = "bottom"
- elseif i == 6 then
- side = "top"
- end
- if Per.getMethods(side) then
- for j,method in pairs(Per.getMethods(side)) do
- if (method == 'isDiskPresent') then
- Disk = Per.wrap(side)
- DiskName = side
- break
- end
- end
- end
- end
- sleep(1)
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.white, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" Checking disk ")) /2), (h-1))
- print(" Checking disk ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- if Disk then
- sleep(1)
- if Disk.isDiskPresent() then
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.white, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" Makes disk ")) /2), (h-1))
- print(" Makes disk ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- sleep(1)
- disk.setLabel(DiskName, "Setup_TRC_OS")
- local file = fs.exists("/disk/StartUp.lua")
- if file then
- fs.delete("/disk/StartUp.lua")
- end
- shell.run("pastebin get TqnHgauG /disk/StartUp.lua")
- Monitor[0].clear()
- Logo.drawLogo(Monitor[0], "Head", math.floor(w/2)-6, math.floor(h/2)-4)
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.white, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" Done ! ")) /2), (h-1))
- print(" Done ! ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- else
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.red, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" No disk found !!! ")) /2), (h-1))
- print(" No disk found !!! ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- error()
- end
- else
- Monitor[0].setCursorPos(1, (h-1))
- Monitor[0].clearLine()
- Functions.SetColors(Monitor[0], colors.red, colors.black)
- Monitor[0].setCursorPos(math.floor((w - string.len(" No disk drive found !!! ")) /2), (h-1))
- print(" No disk drive found !!! ")
- Functions.SetColors(Monitor[0], colors.black, colors.white)
- error()
- end
Advertisement
Add Comment
Please, Sign In to add comment