Advertisement
Guest User

ces_login

a guest
Jan 21st, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. function login()
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4.   term.setTextColor(colors.lightBlue)
  5.   print("***CES-Login***")
  6.   term.setTextColor(colors.gray)
  7.   print("---------------")
  8.   print("Username:")
  9.   write("Password:")
  10.   term.setCursorPos(11,3)
  11.  
  12.   username = read()
  13.   term.setCursorPos(11,4)
  14.   password = read("*")
  15.   if username == "Cripe" and password == "12" then
  16.     term.clear()
  17.     logo = paintutils.loadImage("ces_menu_logo")
  18.     paintutils.drawImage(logo,1,1)
  19.    
  20.     term.setBackgroundColor(colors.black)
  21.     term.setTextColor(colors.lightGray)
  22.     term.setCursorPos(21, 13)
  23.     write("neustarten")
  24.     term.setCursorPos(38,13)
  25.     write("abmelden")
  26.     while true do
  27.       event, mouse, x, y = os.pullEvent("mouse_click")
  28.         if y >= 8 and y <= 12 then
  29.           if x >= 37 and x <= 46 then
  30.             login()
  31.           elseif x >= 21 and x <= 31 then
  32.             os.reboot()
  33.           end
  34.         end
  35.      end
  36.   else
  37.     term.setCursorPos(1,6)
  38.     print("-Falsches Eingabe")
  39.     sleep(1.5)
  40.     term.clear()
  41.     login()
  42.   end
  43. end
  44.  
  45. login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement