Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local maxw, maxh = term.getSize()
- -- IMPLEMENTAZIONE DEL DRAWFILLEDBOX
- local function drawPixelInternal(xPos, yPos)
- term.setCursorPos(xPos, yPos)
- term.write(" ")
- end
- local tColourLookup = {}
- for n = 1, 16 do
- tColourLookup[string.byte("0123456789abcdef", n, n)] = 2 ^ (n - 1)
- end
- function drawFilledBox(startX, startY, endX, endY, nColour)
- if type(startX) ~= "number" or type(startX) ~= "number" or type(endX) ~=
- "number" or type(endY) ~= "number" or
- (nColour ~= nil and type(nColour) ~= "number") then
- error("Expected startX, startY, endX, endY, colour", 2)
- end
- startX = math.floor(startX)
- startY = math.floor(startY)
- endX = math.floor(endX)
- endY = math.floor(endY)
- if nColour then term.setBackgroundColor(nColour) end
- if startX == endX and startY == endY then
- drawPixelInternal(startX, startY)
- return
- end
- local minX = math.min(startX, endX)
- if minX == startX then
- minY = startY
- maxX = endX
- maxY = endY
- else
- minY = endY
- maxX = startX
- maxY = startY
- end
- for x = minX, maxX do for y = minY, maxY do drawPixelInternal(x, y) end end
- end
- function clear()
- sfondo(colors.blue)
- term.clear()
- term.setCursorPos(1, 1)
- end
- function fineColore() term.setTextColour(colours.white) end
- function fineSfondo() term.setBackgroundColour(colours.black) end
- function colore(sfumatura) term.setTextColour(sfumatura) end
- function sfondo(sfumaturaSfondo) term.setBackgroundColour(sfumaturaSfondo) end
- function titolo(testo)
- drawFilledBox(1, 1, maxw, 1, colors.red)
- term.setCursorPos((maxw - #testo) / 2, 1)
- colore(colors.black)
- term.write(testo)
- sfondo(colors.blue)
- end
- clear()
- titolo("Installazione di GEM")
- colore(colors.white)
- sfondo(colors.blue)
- print("\n\nBenvenuti nel programma di installazione di GEM.")
- print("\nPer continuare l'installazione, inserire un nome per questo computer.")
- print("Lasciare il campo vuoto per sceglierlo automaticamente.\n")
- local label = read()
- if label ~= "" or label ~= nil then
- os.setComputerLabel("GemPC-"..tostring(label))
- end
- shell.run("pastebin get dG1EZ5js startup")
- disk.eject("bottom")
- disk.eject("top")
- disk.eject("left")
- disk.eject("right")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement