Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Posizione del Modem
- mSide = "bottom"
- 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(1, 1)
- print(text)
- end
- function button(x, y, text, color, bkcolor)
- term.setBackgroundColor(colors[bkcolor])
- term.setTextColor(colors[color])
- term.setCursorPos(x, y)
- print(text)
- end
- function bkText(text, col, bkcol)
- term.setBackgroundColor(colors[bkcol])
- term.setTextColor(colors[col])
- 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
- -- Attivo MERDGOOGLE
- local modem = peripheral.wrap(mSide)
- modem.setListening(80, true)
- v = 0
- while true do
- if v == 0 then
- term.clear()
- header(" GAUGLE [INFO]", "blue")
- text("\n\nBenvenuto su GAUGLE!\nIn questo browser potrai cercare roba bella!", "black")
- button(15, 7, " CERCA QUALCOSA ", "white", "green")
- button(15, 9, " AGGIORNA GAUGLE ", "white", "orange")
- local event, tasto, x, y = os.pullEvent("mouse_click")
- if y == 7 and x > 15 and x < 33 then
- v = 1
- elseif y == 9 and x > 15 and x < 33 then
- shell.run("rm startup")
- shell.run("pastebin get RCGKxMdS startup")
- shell.run("startup")
- elseif y == 1 and x > 45 then
- v = 3
- else
- shell.run("startup")
- end
- elseif v == 1 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header(" GAUGLE ", "blue")
- term.setCursorPos(10, 6)
- text("Vai al sito:", "black")
- term.setCursorPos(10, 7)
- url = read()
- if url == "gaugle://info" then
- v = 3
- else
- v = 2
- end
- elseif v == 2 then
- term.clear()
- modem.sendChannel(80, url)
- local event, side, id, chn, msg = os.pullEvent("lan_message")
- if msg == "ERROR_404" then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [RESEARCH]", "blue")
- text("http://"..url, "gray")
- text("\nERRORE 404 - Pagina non trovata", "red")
- else
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [RESEARCH]", "blue")
- text("http://"..url, "gray")
- text("\n"..msg, "black")
- end
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x < 7 then
- v = 0
- elseif y == 1 and x > 43 then
- drawFilledBox(5, 7, 37, 10, colours.grey)
- term.setCursorPos(6, 8)
- bkText("Cerca qualcosa:", "white", "gray")
- drawFilledBox(6, 9, 35, 9, colours.blue)
- term.setCursorPos(6, 9)
- url = read()
- if url == "gaugle://info" then
- v = 3
- else
- v = 2
- end
- term.clear()
- end
- elseif v == 3 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE ", "blue")
- text("gaugle://info", "gray")
- text("\n\nGAUUUGLE!\n\nMade by: FoxWorn3365\nVersion: v1.0.3C [RELASE 05]", "black")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x < 10 then
- v = 0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement