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 update(url)
- shell.run("rm startup")
- shell.run("pastebin get "..url.." startup")
- shell.run("reboot")
- 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(".settings") == false then
- v = 5
- else
- shell.run(".settings")
- v = 0
- rednet.open(side)
- 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, " IMPOSTAZIONI ", "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
- v = 100
- elseif y == 1 and x > 45 then
- v = 3
- elseif y == 11 and x > 14 and x < 33 then
- v = 49
- 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, "search()"..url)
- local ip, msg, ptrc = rednet.receive(3)
- if msg == nil 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(8, 2, 40, 2, colours.white)
- term.setCursorPos(8, 2)
- term.setTextColor(colors.gray)
- url = read()
- v = 2
- elseif y == 2 then
- term.setCursorPos(8, 2)
- term.setTextColor(colors.gray)
- url = read()
- v = 2
- 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.9 [Working on Firewall and Responsive]\nType: Default (UP-TO-DATE) GOOD!\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(".settings", "w")
- f.writeLine("modem = "..mdwifi)
- f.writeLine("side = '"..mdside.."'")
- f.close()
- -- Confermo la creazione
- shell.run("startup")
- 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
- elseif v == 49 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [Impostazioni]", "blue")
- text("gaugle://settings", "gray")
- text("\n\nImpostazioni di Gauugle:", "black")
- button(15, 8, " Impostazioni di Rete ", "white", "orange")
- button(15, 10, " Impostazioni Firewall ", "white", "orange")
- button(15, 12, " Centro Assistenza ", "white", "red")
- local event, bt, x, y = os.pullEvent("mouse_click")
- if y == 8 then
- v = 5
- elseif y == 10 then
- v = 51
- elseif y == 1 then
- v = 0
- end
- elseif v == 50 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [FireWall]", "blue")
- text("gaugle://firewallManager", "gray")
- text("\nImpostazioni dei FireWall:", "black")
- rednet.send(modem, "firewall()sus")
- ma = {}
- lo, msg, ptrc = rednet.receive(5)
- if msg == nil then
- print("Al momento non ci sono porte aperte...")
- else
- open = textutils.unserialize(msg)
- nan = 1
- for v, d in pairs(open) do
- ma[nan] = {d, "ATTIVA"}
- print("> Porta: "..d.." | Status: APERTA\n")
- local x, y = term.getCursorPos()
- button(x + 35, y - 2, " CHIUDI ", "white", "red")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- nan = nan + 1
- sleep(0.1)
- end
- end
- local event, t, x, y = os.pullEvent("mouse_click")
- if y == 1 then
- v = 0
- elseif y > 4 and y <= nan + 4 then
- doa = ma[y - 4]
- rednet.send(modem, "remove()"..doa[1])
- v = 51
- end
- elseif v == 51 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [FireWall]", "blue")
- text("gaugle://firewall", "gray")
- text("\nGestisci i FireWall", "black")
- button(15, 6, " Visualizza le Porte Aperte ", "white", "orange")
- button(15, 8, " Apri una Nuova Porta ", "white", "orange")
- local event, t, x, y = os.pullEvent("mouse_click")
- if y == 6 then
- v = 50
- elseif y == 8 then
- v = 52
- elseif y == 1 then
- v = 0
- end
- elseif v == 52 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [FireWall]", "blue")
- text("gaugle://firewallOpenDoor", "gray")
- text("\nApri una porta dal Firewall", "black")
- text("\n\n\nInserisci la porta da aprire (01 - 128)", "black")
- porta = read()
- if tonumber(porta) > 128 then
- text("NUMERO TROPPO GRANDE! MASSIMO 128!", "red")
- sleep(2)
- v = 52
- else
- rednet.send(modem, "add()"..porta)
- v = 51
- end
- elseif v == 100 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Update ]", "blue")
- text("gaugle://update", "gray")
- text("\nScegli una versione di gaugle:", "black")
- button(10, 7, " GAUGLE! Default ", "white", "orange")
- button(10, 9, " GAUGLE! ResponsiveTM ", "white", "yellow")
- button(10, 11, " GAUGLE! Legacy (No Gaugle Modem) ", "white", "yellow")
- button(10, 13, " GAUGLE! Plug-in UP! ", "white", "red")
- text("Sconsigliato! FORTEMENTE!!!", "gray")
- local event, bt, x, y = os.pullEvent("mouse_click")
- if y == 7 then
- update("Q9eXCRxV")
- elseif y == 9 then
- update("9unTEcAt")
- elseif y == 11 then
- update(" NO sus")
- elseif y == 13 then
- update(" quite susu")
- elseif y == 1 then
- v = 0
- end
- end
- end
Add Comment
Please, Sign In to add comment