Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local maxw, maxh = term.getSize()
- function clear()
- term.clear()
- term.setCursorPos(1, 1)
- term.setBackgroundColour(colours.black)
- term.setTextColor(colors.white)
- end
- function colore(sfumatura) term.setTextColour(sfumatura) end
- function fineColore() term.setTextColour(colours.white) end
- function sfondo(sfumaturaSfondo) term.setBackgroundColour(sfumaturaSfondo) end
- function fineSfondo() term.setBackgroundColour(colours.black) end
- -- 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 titolo(testo)
- drawFilledBox(1, 1, maxw, 1, colors.red)
- term.setCursorPos((maxw - #testo) / 2, 1)
- colore(colors.white)
- term.write(testo)
- sfondo(colors.blue)
- end
- while true do
- sfondo(colors.blue)
- clear()
- titolo("Installazione N AUDIO SYSTEM")
- print("\n\n")
- print("Si sta eseguendo GEM su questo computer?")
- print("\n1. Si\n2. No\n")
- local isGem = read()
- if isGem == "1" then
- shell.run("rm /programs/icons/NPlayer")
- shell.run("rm /programs/NPlayer")
- shell.run("pastebin get Ei4HDiwy /programs/icons/NPlayer")
- shell.run("pastebin get TyTyYRQd /programs/NPlayer")
- clear()
- titolo("Installazione N AUDIO SYSTEM")
- print("\n\n")
- print("Installazione completata. Rimuovere il disco.")
- os.pullEvent("disk_eject")
- os.reboot()
- elseif isGem == "2" then
- shell.run("pastebin get TyTyYRQd /NPlayer")
- clear()
- titolo("Installazione N AUDIO SYSTEM")
- print("\n\n")
- print("Installazione completata.\nPer eseguire N Audio System, digitare nel terminale:\nnplayer\nRimuovere il disco.")
- os.pullEvent("disk_eject")
- os.reboot()
- else
- clear()
- titolo("Installazione N AUDIO SYSTEM")
- print("\n\n")
- print("Scelta non valida")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement