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(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
- if fs.exists("modem") == false then
- v = 5
- else
- file = fs.open("modem", "r")
- modem = file.readAll()
- file.close()
- filea = fs.open("side", "r")
- side = filea.readAll()
- filea.close()
- rednet.open(side)
- v = 0
- end
- 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")
- button(15, 11, " REIMPOSTA 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 7Pdn3tqd startup")
- shell.run("startup")
- elseif y == 1 and x > 45 then
- v = 3
- elseif y == 11 and x > 14 and x < 33 then
- v = 5
- 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
- elseif url == "gaugle://mail?rtoken=rednet_TEXT_833jdjdu_B" then
- v = 10
- else
- v = 2
- end
- elseif v == 2 then
- term.clear()
- rednet.send(modem, url)
- local ip, msg, ptrc = rednet.receive()
- 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.3E [RELASE 05]\n\nConfiguration Information:\nType: WIRELESS_2.0\nModem IP: 144.91.97."..modem.."\nModem side: "..side, "black")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x < 10 then
- v = 0
- end
- elseif v == 5 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[INST] GAUGLE ", "blue")
- text("\n\nInstallazione di GAUGLE", "black")
- text("\nInserisci l'ID del Modem WIFI:", "black")
- local mdwifi = read()
- text("\n\nPerfetto, ora inserisci il lato dove e' presente il wm:", "black")
- local mdside = read()
- local f = fs.open("modem", "w")
- f.writeLine(mdwifi)
- f.close()
- local fa = fs.open("side", "w")
- fa.writeLine(mdside)
- fa.close()
- -- Confermo la creazione
- shell.run("reboot")
- elseif v == 10 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ MAIL ]", "blue")
- text("gaugle://mail", "gray")
- text("\nBenvenuto nella casella MAIL di GAUGLE!", "black")
- button(15, 6, " INVIA UNA EMAIL ", "white", "blue")
- button(15, 8, " LE TUE EMAIL ", "white", "blue")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 6 and x > 15 and x < 32 then
- v = 15
- elseif y == 8 and x > 15 and x < 32 then
- v = 12
- elseif y == 1 and x < 7 then
- v = 0
- end
- elseif v == 15 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ MAIL ]", "blue")
- text("gaugle://mail#send", "gray")
- text("\n\nInvia un'email!", "black")
- text("\n\nInserisci il destinatario:", "blue")
- term.setCursorPos(3, 9)
- print("@mail.com")
- term.setCursorPos(1, 9)
- to = read()
- print(to)
- text("\n\nInserisci il Messaggio:", "blue")
- mam = read()
- print(mam)
- text("Inviato "..mam.." a "..to.."@mail.com", "green")
- rednet.send(to, mam)
- os.pullEvent("mouse_click")
- v = 10
- end
- end
Add Comment
Please, Sign In to add comment