Advertisement
PolskiWisnia

login

Apr 29th, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | None | 0 0
  1. local function s(...) return sleep(...) end
  2. local function w(...) return write(...) end
  3. local function p(...) return print(...) end
  4. local function tw(...) return term.write(...) end
  5. local function scp(...) return term.setCursorPos(...) end
  6. local function sbc(...) return term.setBackgroundColor(...) end
  7. local function stc(...) return term.setTextColor(...) end
  8. local function tc(...) return term.clear(...) end
  9. local function tcl(...) return term.clearLine(...) end
  10. local function r(...) return shell.run(...) end
  11. local function sp(...) return textutils.slowPrint(...) end
  12. local function sw(...) return textutils.slowWrite(...) end
  13. local function fse(...) return fs.exists(...) end
  14. local function pul(...) return paintutils.loadImage(...) end
  15. local function pud(...) return paintutils.drawImage(...) end
  16. local function pfb(...) return paintutils.drawFilledBox(...) end
  17. local function su(...) return os.shutdown(...) end
  18. local function re(...) return os.reboot(...) end
  19. while true do
  20. if fs.exists("/os/.log1") and fs.exists("/os/.log2") then ok = 1 else r("/os/.menu") end
  21. tc()
  22. pfb(1, 1, 51, 5, colors.blue)
  23. pfb(1, 6, 51, 14, colors.lightBlue)
  24. pfb(1, 15, 51, 19, colors.blue)
  25. scp(1,1)
  26. p("Logowanie MineCore")
  27. scp(1,2)
  28. p("Wybierz uzytkownika, a nastepnie wpisz haslo.")
  29. local u = fs.open("/os/.log1", "r")
  30. user = u.readLine(1)
  31. u.close()
  32. local h = fs.open("/os/.log2", "r")
  33. pass = h.readLine(1)
  34. h.close()
  35. scp(51,19)
  36. sbc(colors.red)
  37. w("X")
  38. pfb(15, 7, 17, 9, colors.gray)
  39. scp(18,7)
  40. sbc(colors.lightBlue)
  41. p(user)
  42. local event, click, x, y = os.pullEvent("mouse_click")
  43. if x == 51 and y == 19 then os.shutdown() end
  44. if x>14 and x<18 and y>6 and y<10 then
  45.  scp(18, 8)
  46.  w("Wpisz haslo: ")
  47.  haslo = read()
  48.  if haslo == pass then r("/os/.menu") else scp(18,9) stc(colors.white) sbc(colors.red) p("Bledne haslo!") sleep(2) end
  49. end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement