Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.white)
- term.clear()
- -- Sistemo le funzioni per tutto
- function header(text, color)
- term.setBackgroundColor(colors[color])
- term.setTextColor(colors.white)
- term.setCursorPos(15, 1)
- print(text)
- end
- function button(x, y, text, color, bkcolor)
- term.setBackgroundColor(colors[bkcol])
- term.setTextColor(colors[color])
- term.setCursorPos(x, y)
- print(text)
- end
- function text(text, color)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors[color])
- print(text)
- end
- function n(col)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors[col])
- end
- function popupPos(aa)
- term.setCursorPos(5, aa)
- end
- function popup(text, text1, text2, text3, text4, text5) --TEXT = MAX 15 - MM = MAX 15
- drawFilledBox(5, 2, 27, 9, colours.grey)
- term.setTextColor(colors.white)
- term.setCursorPos(5, 2)
- print("|---------------------|")
- term.setCursorPos(5, 3)
- print(text)
- popupPos(4)
- print(text1)
- popupPos(5)
- print(text2)
- popupPos(6)
- print(text3)
- popupPos(7)
- print(text4)
- popupPos(8)
- print(text5)
- term.setCursorPos(5, 9)
- print("|---------------------|")
- end
- 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
- popup("DIOPOCO", "aa", "aa", "a", "a", "a")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement