Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.white)
- term.clear()
- -- Hack OS - v0.19
- -- By FoxWorn3365
- -- APPUNTI
- -- Configurazioni sistema: .localConf
- -- Configurazioni pubbliche: .publicConf
- -- Immagini: /Hack/images/
- -- APP: /Hack/programmi/
- -- App di esempio:
- -- Directory: /Hack/programmi/fileManager/
- -- Icona: /Hack/programmi/fileManager/app.ico
- -- File da eseguire: /Hack/programmi/fileManager/exec.luaDir
- -- Configurazioni (facoltativo) (OBBLIGO AUTOGENERAZIONE): /Hack/programmi/fileManager/conf.public
- -- Nome dell'APP (massimo 4 caratteri): /Hack/programmi/fileManager/app.name
- -- API: https://fcosma.it/hackos/api
- maxw, maxh = term.getSize()
- 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
- function giremu(inputstr, sep)
- local t={}
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- table.insert(t, str)
- end
- return t
- end
- function clear()
- sfondo(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- end
- function clearRed()
- sfondo(colors.red)
- term.clear()
- term.setCursorPos(1, 1)
- end
- function titolo(testo)
- drawFilledBox(1, 1, maxw, 1, colors.red)
- term.setCursorPos((maxw - #testo) / 2, 1)
- term.setTextColor(colors.white)
- term.write(testo)
- end
- function alarm(testo, colore, y)
- drawFilledBox(1, y, maxw, y, colors[colore])
- term.setCursorPos((maxw - #testo) / 2, y)
- term.setTextColor(colors.white)
- term.write(testo)
- no()
- end
- function modi(file, cont)
- local h = fs.open(file, "w")
- h.writeLine(cont)
- h.flush()
- h.close()
- end
- function bottone(color, text, x, y)
- term.setBackgroundColor(colors[color])
- term.setTextColor(colors.white)
- term.setCursorPos(x, y)
- print(text)
- end
- function drawA()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- function ico(x, y, color, text)
- term.setBackgroundColor(colors[color])
- term.setTextColor(colors.white)
- term.setCursorPos(x, y)
- print(text)
- drawA()
- end
- function menu()
- drawA()
- term.clear()
- titolo("Hack OS - Store")
- ico(51, 1, "gray", "X")
- end
- don = 0
- while true do
- if don == 0 then
- menu()
- print("\nAPP Popolari:")
- ico(3, 5, "green", " FMan ")
- ico(15, 5, "green", " LeNet ")
- ico(27, 5, "green", " NPay ")
- print("\nAltre APP:")
- ico(3, 8, "green", " LuaIN ")
- ico(15, 8, "green", " SNAKE ")
- ico(27, 8, "green", " XTerm ")
- ico(3, 10, "green", " Calc ")
- ico(15, 10, "orange", " Hiro Hot Chat <3 ")
- local event, lol, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 and x > 15 then
- don = 10
- elseif y == 8 and x > 3 and x < 10 then
- don = 1
- elseif y == 8 and x > 15 and x < 22 then
- don = 2
- elseif y == 8 and x > 27 then
- don = 3
- -- Popolari
- elseif y == 5 and x > 3 and x < 10 then
- don = 4
- elseif y == 5 and x > 15 and x < 22 then
- don = 5
- elseif y == 5 and x > 27 then
- don = 6
- elseif y == 10 then
- don = 7
- end
- elseif don == 1 then
- menu()
- print("\nApplicazione: LuaIN")
- print("\n\nUsa lua con una semplice interfaccia shell!")
- if fs.isDir("/Hack/programmi/luaIn") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 0.4kb\nAutore: FoxWorn3365")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 5kb\nAutore: FoxWorn3365")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/luaIn")
- modi("/Hack/programmi/luaIn/exec.luaDir", "term.setBackgroundColor(colors.black)\nterm.setTextColor(colors.white)\nterm.clear()\nterm.setCursorPos(1, 1)\nshell.run('lua')")
- modi("/Hack/programmi/luaIn/app.ico", "4 4\n4 4\n4444")
- modi("/Hack/programmi/luaIn/app.name", "LuaIN")
- sleep(0.7)
- shell.run("desktop")
- else
- shell.run("rm /Hack/programmi/luaIn")
- end
- end
- elseif don == 2 then
- menu()
- print("\nApplicazione: SNAKE")
- print("\n\nUn fantastico gioco creato da lego11 :D")
- if fs.isDir("/Hack/programmi/snakeGame") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 5kb\nAutore: lego11")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 5kb\nAutore: lego11")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/snakeGame")
- shell.run("pastebin get SUwpHUrU /Hack/programmi/snakeGame/exec.luaDir")
- modi("/Hack/programmi/snakeGame/app.ico", "5b e\n5\n55")
- modi("/Hack/programmi/snakeGame/app.name", " Snake")
- sleep(0.7)
- shell.run("desktop")
- else
- shell.run("rm /Hack/programmi/snakeGame")
- end
- end
- elseif don == 3 then
- menu()
- print("\nApplicazione: XTerm")
- print("\n\nAccedi alla console in pochi e semplici passi!")
- if fs.isDir("/Hack/programmi/xterm") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 5kb\nAutore: FoxWorn3365")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 0.7kb\nAutore: FoxWorn3365")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/xterm")
- shell.run("pastebin get Y4pWiuQ4 /Hack/programmi/xterm/exec.luaDir")
- modi("/Hack/programmi/xterm/app.ico", "7477\n7747\n7477")
- modi("/Hack/programmi/xterm/app.name", "XTerm")
- sleep(0.7)
- shell.run("desktop")
- else
- shell.run("rm /Hack/programmi/xterm")
- end
- end
- elseif don == 4 then
- menu()
- print("\nApplicazione: FMan")
- print("\n\nUn File Manager semplice, leggero ed intuitivo creato dal nostro mitico Lego11")
- ico(5, 10, "orange", " AGGIORNA ")
- app = "aggiorna"
- print("\nPeso app: 3.59kb\nAutore: lego11")
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- if app == "aggiorna" then
- shell.run("rm /Hack/programmi/fileManager/exec.luaDir")
- shell.run("pastebin get 4auWPCSL /Hack/programmi/fileManager/exec.luaDir")
- sleep(0.7)
- shell.run("desktop")
- end
- end
- elseif don == 5 then
- menu()
- print("\nApplicazione: LeNet")
- print("\n\nUn web browser leggero e facile da usare creato da lego11")
- ico(5, 10, "orange", " AGGIORNA ")
- app = "aggiorna"
- print("\nPeso app: 1.298kb\nAutore: lego11")
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- shell.run("rm /Hack/programmi/leNet/exec.luaDir")
- shell.run("pastebin get 8yUDr8Yt /Hack/programmi/leNet/exec.luaDir")
- sleep(0.7)
- shell.run("desktop")
- end
- elseif don == 6 then
- menu()
- print("\nApplicazione: NPay")
- print("\n\nGestisci le tue finanze dal tuo portatile HackOS!")
- if fs.isDir("/Hack/programmi/nPay") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 9.29kb\nAutore: lego11")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 9.29kb\nAutore: lego11")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("startup")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/nPay")
- shell.run("pastebin get TFQY7tRH /Hack/programmi/nPay/exec.luaDir")
- modi("/Hack/programmi/nPay/app.ico", "44 4\n4 44\n4 4")
- modi("/Hack/programmi/nPay/app.name", "NPay")
- else
- shell.run("rm /Hack/programmi/nPay")
- end
- end
- elseif don == 7 then
- menu()
- print("\nApplicazione: Calc")
- print("\n\nUna semplice, leggera ma rapida applicazione per il tuo HackOS")
- if fs.isDir("/Hack/programmi/calculator") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 0.04kb\nAutore: FoxWorn3365")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 0.04kb\nAutore: FoxWorn3365")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("startup")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/calculator")
- shell.run("pastebin get yadZMu0c /Hack/programmi/calculator/exec.luaDir")
- modi("/Hack/programmi/calculator/app.ico", "bbb \n bb \nbbbb")
- modi("/Hack/programmi/calculator/app.name", "Calc")
- else
- shell.run("rm /Hack/programmi/calculator")
- end
- end
- elseif don == 10 then
- menu()
- print("\nApplicazione: Chat Hot con Hiro")
- print("\n\nChatta direttamente con Hiro")
- if fs.isDir("/Hack/programmi/chatHiro") ~= true then
- ico(5, 10, "green", " INSTALLA L'APP ")
- app = "installa"
- print("\nPeso app: 19.6kb\nAutore: FoxWorn3365")
- else
- ico(5, 10, "green", " DISINSTALLA ")
- app = "disinstalla"
- print("\nPeso app: 19.6kb\nAutore: FoxWorn3365")
- end
- ico(1, 1, "blue", "<-")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 1 and x == 1 or x == 2 then
- don = 0
- elseif y == 1 and x == 51 then
- shell.run("desktop")
- elseif y == 10 then
- if app == "installa" then
- shell.run("mkdir /Hack/programmi/chatHiro")
- shell.run("pastebin get 2Kw6KdQ7 /Hack/programmi/chatHiro/exec.luaDir")
- modi("/Hack/programmi/chatHiro/app.ico", "1111\n1616\n6666")
- modi("/Hack/programmi/chatHiro/app.name", "Hiro")
- else
- shell.run("rm /Hack/programmi/chatHiro")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment