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(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 giremu(inputstr, sep)
- if sep == nil then
- sep = "%s"
- end
- local t={}
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- table.insert(t, str)
- end
- return t
- 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 textNoCC(text, color)
- term.setTextColor(colors[color])
- print(text)
- end
- function n(col)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors[col])
- end
- function downstream()
- local startTime = os.clock()
- rednet.send(modem, "search()server.speedtest.net")
- local ip, msg, ptrc = rednet.receive(6)
- local endTime = os.clock()
- local difference = endTime - startTime
- local ra = 1 / difference
- local res = ra * 1000
- return res
- 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.setBackgroundColor(colors.white)
- 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")
- button(15, 13, " APPLICAZIONI ", "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
- elseif y == 13 and x > 14 and x < 33 then
- v = 550
- 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
- elseif url == "gaugle://dev" then
- v = 200
- elseif url == "gaugle://form" then
- v = 195
- else
- v = 2
- end
- elseif v == 2 then
- term.clear()
- rednet.send(modem, "search()"..url)
- local ip, msg, ptrc = rednet.receive(3)
- msgcp = msg
- 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")
- elseif string.find(msg, "isResponsive") ~= nil then
- resp = giremu(msgcp, "$")
- bkcolorNow = tostring(resp[3])
- term.setBackgroundColor(colors[bkcolorNow])
- term.clear()
- header("[HOME] GAUGLE [RESEARCH]", "blue")
- drawFilledBox(1, 2, 51, 2, colours.white)
- term.setCursorPos(1, 2)
- text("http://"..url, "gray")
- term.setBackgroundColor(colors[bkcolorNow])
- textNoCC("\n"..resp[4], resp[2])
- else
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [RESEARCH]", "blue")
- text("http://"..url, "gray")
- term.setBackgroundColor(colors.white)
- text("\n"..msgcp, "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
- drawFilledBox(8, 2, 40, 2, colours.white)
- 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: v2.0 FINALLY!\nType: Responsive (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")
- 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
- elseif v == 200 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Dev ]", "blue")
- text("gaugle://dev", "gray")
- text("\nDevelopers Place - Gaugle", "black")
- button(10, 6, " Controlla se la pagina e' ResponsiveTM ", "white", "orange")
- button(10, 8, " Pinga un sito web ", "white", "orange")
- button(10, 10, " Esegui uno Speedtest ", "white", "orange")
- local event, ktasto, x, y = os.pullEvent("mouse_click")
- if y == 1 then
- v = 0
- elseif y == 6 then
- v = 201
- elseif y == 8 then
- v = 202
- elseif y == 10 then
- v = 203
- end
- elseif v == 201 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Dev ]", "blue")
- text("gaugle://dev/isResponsive", "gray")
- text("\nDevelopers Place - Gaugle", "black")
- text("\n\nControlla se una pagina e' responsive", "black")
- text("\n\nInserisci il link: (Ci vorranno circa 10s)", "black")
- text("http://", "black")
- term.setCursorPos(8, 11)
- pageIS = read()
- -- Check if the page is responsive
- rednet.send(modem, "search()"..pageIS)
- local ip, msg, ptrc = rednet.receive(10)
- if string.find(msg, "isResponsive") ~= nil then
- text("\n\nLa pagina e' responsive (RES_v1.0)", "green")
- else
- text("\n\nLa pagina NON E' responsive", "red")
- end
- text("Clicca sullo schermo per continuare", "orange")
- os.pullEvent("mouse_click")
- elseif v == 202 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Dev ]", "blue")
- text("gaugle://dev/pingWebsite", "gray")
- text("\nDevelopers Place - Gaugle", "black")
- text("\n\nPinga un sito web", "black")
- text("\n\nInserisci il link: (Ci vorranno circa 5s max)", "black")
- text("http://", "black")
- term.setCursorPos(8, 11)
- pageIS = read()
- local startTime = os.clock()
- rednet.send(modem, "search()"..pageIS)
- local ip, msg, ptrc = rednet.receive(6)
- local endTime = os.clock()
- local difference = endTime - startTime
- text("\n\nEcco i risultati del ping effettuato al sito web:\nhttp://"..pageIS.."\nPing: "..difference.."s", "green")
- text("\n\nClicca sullo schermo per procedere", "orange")
- os.pullEvent("mouse_click")
- elseif v == 203 then
- term.setBackgroundColor(colors.black)
- term.clear()
- header("[HOME] GAUGLE [ Dev ]", "blue")
- drawFilledBox(1, 2, 51, 2, colours.white)
- term.setCursorPos(1, 2)
- text("gaugle://dev/speedtest", "gray")
- term.setBackgroundColor(colors.black)
- textNoCC("\nDevelopers Place - Gaugle", "white")
- textNoCC("\n\nSpeedtest by Ookla", "white")
- textNoCC("\n\n CLICCA SULLO SCHERMO PER INIZIARE!", "white")
- os.pullEvent("mouse_click")
- textNoCC("Connessione in corso a server.speedtest.net.....\nServer localizzato a Neihemiah, connesso!", "white")
- textNoCC("[1 / 4] "..downstream().."Mbps", "lime")
- sleep(1)
- textNoCC("[2 / 4] "..downstream().."Mbps", "lime")
- sleep(1)
- textNoCC("[3 / 4] "..downstream().."Mbps", "lime")
- sleep(1)
- textNoCC("[4 / 4] "..downstream().."Mbps", "lime")
- sleep(1)
- textNoCC("TEST FINITO! TOCCA LO SCHERMO PER PROCEDERE!", "orange")
- os.pullEvent("mouse_click")
- elseif v == 195 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Dev ]", "blue")
- text("gaugle://formSend", "gray")
- text("\nInvia un form a uno specifico sito web:\n\nInserisci il sito web:", "black")
- text("http://", "black")
- term.setCursorPos(8, 7)
- webIS = read()
- text("\nOra inserisci il testo da inviare:", "black")
- formIS = read()
- rednet.send(modem, "search()"..webIS.."$"..formIS)
- text("\nFORM INVIATO!\nClicca sullo schermo per tornare alla home", "orange")
- local ip, msg, ptrc = rednet.receive(3)
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [RESEARCH]", "blue")
- text("http://"..webIS, "gray")
- term.setBackgroundColor(colors.white)
- text("\n"..msg, "black")
- os.pullEvent("mouse_click")
- v = 0
- elseif v == 550 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ App ]", "blue")
- text("gaugle://app/listAll", "gray")
- text("\nApplicazioni Installate", "black")
- button(10, 7, " Games ", "white", "orange")
- button(10, 9, " Developers ", "white", "orange")
- button(10, 11, " Messanger ", "white", "orange")
- local event, bt, x, y = os.pullEvent("mouse_click")
- if y == 1 then
- v = 0
- elseif y == 7 then
- v = 500
- elseif y == 9 then
- v = 200
- elseif y == 11 then
- if fs.exists(".chat") then
- v = 701
- else
- v = 750
- end
- end
- elseif v == 500 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Games ]", "blue")
- text("gaugle://games", "gray")
- text("\nGiochi di Gaugle! ONLINE!", "black")
- text("\nLista dei giochi: http://games.gaugle.com/list", "black")
- text("\n\nInserisci il server di gioco:", "black")
- text("http://", "black")
- term.setCursorPos(8, 10)
- games = read()
- local startTime = os.clock()
- rednet.send(modem, "game()"..games)
- local endTime = os.clock()
- local e, msg, p = rednet.receive(4)
- if msg == nil or msg == "sussy baka" then
- text("Il server di gioco non risponde!\nClicca sullo schermo per riprovare!", "red")
- os.pullEvent("mouse_click")
- v = 0
- else
- text("Connesso con successo al server di gioco!\nPing: "..startTime - endTime.."s", "green")
- text("Clicca sullo schermo per procedere!", "lime")
- os.pullEvent("mouse_click")
- v = 501
- end
- elseif v == 501 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Games ]", "blue")
- text("gaugle://games/launchGame", "gray")
- text("\nGiochi di Gaugle! ONLINE!", "black")
- if string.find(games, "x&o") ~= nil then
- gName = "Tris"
- gPage = 510
- else
- gName = "Yes or No"
- gPage = 520
- end
- text("\n\nStiamo avviando il gioco "..gName.."....", "orange")
- text(textutils.slowPrint("###############"), "red")
- rednet.send(modem, "game()"..games.."/user")
- local res, mer, sus = rednet.receive(3)
- tex = giremu(mer, "&")
- for a, ms in pairs(tex) do
- write(" "..ms.." |")
- end
- text("\n\nFatto! Scegli tra uno degli username elencati sopra!", "black")
- user = read()
- rednet.send(modem, "game()"..games.."/check$"..user)
- local hs, msg, sus = rednet.receive(3)
- if msg == "NO" then
- text("IL TUO USERNAME NON E' VALIDO!\nClicca sullo schermo", "red")
- os.pullEvent("mouse_click")
- v = 550
- else
- text("\n\nOk, benvenuto "..user.." in questa partita!\n\nClicca sullo schermo per partire!", "black")
- os.pullEvent("mouse_click")
- rednet.send(modem, "game()"..games.."/new$"..user)
- rednet.receive(5)
- v = gPage
- end
- elseif v == 510 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Games ]", "blue")
- text("gaugle://games/playGame/"..gName, "gray")
- sleep(0.2)
- rednet.send(modem, "game()"..games.."/pick")
- aa, ms, sus = rednet.receive(10)
- if ms == nil then
- text("Il server di gioco da te scelto non risponde piu'!\nClicca sullo schermo per continuare", "red")
- else
- grid = giremu(ms, "$")
- if grid[1] ~= "isGrid" then
- print("La richiesta ricevuta e' errata, pertanto siete gentilmente pregati di aspettare il prossimo refresh (3.5sec)")
- sleep(3)
- else
- turn = grid[2]
- print("\n"..grid[3].."|"..grid[4].."|"..grid[5].."\n-|-|-\n"..grid[6].."|"..grid[7].."|"..grid[8].."\n-|-|-\n"..grid[9].."|"..grid[10].."|"..grid[11])
- term.setCursorPos(30, 6)
- text("[ FERMA ]", "red")
- if turn == user then
- text("\n\n\nNON E' IL TUO TURNO, ASPETTA!", "red")
- sleep(3.5)
- else
- text("\n\n\nE' IL TUO TURNO, ESEGUI LA MOSSA!", "green")
- local event, ms, x, y = os.pullEvent("mouse_click")
- if y == 4 and x == 1 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s1")
- sleep(2)
- elseif y == 4 and x == 3 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s2")
- sleep(2)
- elseif y == 4 and x == 5 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s3")
- sleep(2)
- elseif y == 6 and x == 1 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s4")
- sleep(2)
- elseif y == 6 and x == 3 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s5")
- sleep(2)
- elseif y == 6 and x == 5 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s6")
- sleep(2)
- elseif y == 8 and x == 1 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s7")
- sleep(2)
- elseif y == 8 and x == 3 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s8")
- sleep(2)
- elseif y == 8 and x == 5 then
- rednet.send(modem, "game()"..games.."/update$"..user.."$s9")
- sleep(2)
- elseif y == 6 and x > 30 then
- rednet.send(modem, "game()"..games.."/stop")
- text("\n\nGIOCO FINITO!\nClicca un tasto qualsiasi per tornare alla home dei giochi", "green")
- os.pullEvent("mouse_click")
- v = 500
- end
- end
- end
- end
- elseif v == 710 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/index", "gray")
- text("\n\nIstant Messanger - Iscrizione", "black")
- text("\nInserisci un username valido (NO SPAZI E $)", "black")
- userT = read()
- if userT == nil then
- text("\nATTENZIONE: Non hai inserito un username!", "red")
- os.pullEvent("mouse_click")
- v = 550
- else
- text("\nOk, ciao "..userT..", ora inserisci una password: (NO $)", "black")
- userP = read()
- if userP == nil then
- text("\nPASSWORD vuota, NON VALIDA!", "red")
- os.pullEvent("mouse_click")
- v = 550
- else
- text("\nOk, password valida! Clicca sullo schermo per inscriverti!", "lime")
- os.pullEvent("mouse_click")
- -- url$username$password
- rednet.send(modem, "chat()server.chat.gaugle.com/register$"..userT.."$"..userP)
- local x, mes, a = rednet.receive(10)
- if mes == nil then
- term.clear()
- term.setBackgroundColor(colors.white)
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/subscribe", "gray")
- text("\n\nATTENZIONE!\nProblemi:\n1) Non sei connesso ad internet - riavvia il modem\n2) La porta 70 e' bloccata dai firewall", "red")
- os.pullEvent("mouse_click")
- v = 510
- elseif mes == "NO" then
- term.clear()
- term.setBackgroundColor(colors.white)
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/subscribe", "gray")
- text("\n\nL'username che hai scelto ("..userT..") e' gia' stato preso!", "orange")
- os.pullEvent("mouse_click")
- v = 510
- else
- term.clear()
- term.setBackgroundColor(colors.white)
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/subscribe", "gray")
- text("\n\nOk, benvenuto "..userT.." nel servizio di chat online di Gaugle!\n\nClicca sullo schermo per procedere!", "black")
- os.pullEvent("mouse_click")
- v = 711
- end
- end
- end
- elseif v == 750 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/helo", "gray")
- text("\n\nIstant Messanger - Hello!", "black")
- button(10, 7, " ACCEDI ", "white", "orange")
- button(10, 9, " REGISTRATI ", "white", "orange")
- local event, xus, x, y = os.pullEvent("mouse_click")
- if y == 1 then
- v = 0
- elseif y == 7 then
- v = 711
- elseif y == 9 then
- v = 710
- end
- elseif v == 711 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/login", "gray")
- text("\n\nIstant Messanger - Login", "black")
- text("\n\n\nUsername:", "black")
- useLs = read()
- rednet.send(modem, "chat()server.chat.gaugle.com/checkUsername$"..useLs)
- local x, mes, so = rednet.receive(10)
- if mes ~= "SI" then
- text("L'UTENTE NON ESISTE!", "red")
- os.pullEvent("mouse_click")
- v = 550
- else
- text("\nOk, ora inserisci la password:", "black")
- usePl = read()
- -- url$username$password
- rednet.send(modem, "chat()server.chat.gaugle.com/login$"..useLs.."$"..usePl)
- local as, mes, os = rednet.receive(10)
- if mes ~= "SI" then
- text("Password ERRATA!", "red")
- os.pullEvent("mouse_click")
- v = 711
- else
- text("Sei stato loggato con successo nel tuo account Gaugle Messanger!", "lime")
- local h = fs.open(".chat", "w")
- h.write(useLs)
- h.flush()
- h.close()
- os.pullEvent("mouse_click")
- v = 701
- end
- end
- elseif v == 701 then
- -- Recupero l'username
- if fs.exists(".chat") == true then
- local h = fs.open(".chat", "r")
- userChat = h.readAll()
- h.close()
- else
- v = 750
- end
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/dashboard/", "gray")
- text("\n\nIstant Messanger - Dashboard", "black")
- text("\nBenvenuto, "..userChat.." nel tuo account Gaugle Messanger!", "black")
- text("\n\n\nAccedi ad una conversazione!\nInserisci il nome dell'altro partecipante:", "black")
- otherU = read()
- text("Ok, sto cercando una chat di nome "..userChat.."&"..otherU, "green")
- -- url$chat&chat
- v = 702
- elseif v == 702 then
- term.setBackgroundColor(colors.white)
- term.clear()
- header("[HOME] GAUGLE [ Chat ]", "blue")
- text("gaugle://games/chat/wiewChat", "gray")
- text("\n\nIstant Messanger - Wiew Chat\nChat: "..userChat.."&"..otherU, "black")
- rednet.send(modem, "chat()server.chat.gaugle.com/get$"..userChat.."&"..otherU)
- ar, chata, sus = rednet.receive(5)
- text("\n"..chata, "black")
- text("\nScrivi un messaggio (scrivi r per ricaricare)", "black")
- messageSend = read()
- if messageSend ~= "r" then
- -- url$chat$message
- rednet.send(modem, "chat()server.chat.gaugle.com/sendMessage$"..userChat.."&"..otherU.."$"..messageSend)
- sleep(2.5)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement