Guest User

startup

a guest
Jan 15th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. function main()
  3.  term.clear()
  4.  term.setCursorPos(1,1)
  5.  term.write("Username: ")
  6.  user = read()
  7.  if(user == "Paradox") then
  8.   term.write("Password: ")
  9.   pass = read("*")
  10.   if(pass == "luciferparadox11") then
  11.    print("Bienvenido")
  12.   else
  13.    print("Password incorrecta")
  14.    sleep(1)
  15.    os.reboot()
  16.   end
  17.  else
  18.   print("No existe ese usuario")
  19.   sleep(1)
  20.   os.reboot()
  21.  end
  22. end
  23.  
  24. function escucha()
  25.  rednet.open("top")
  26.  rem=76
  27.  while true do
  28.   id,msg = rednet.receive()
  29.   if(id==rem) then
  30.    if(msg == "atx_getid") then
  31.     rednet.send(id,"atx_id")
  32.    else
  33.     func = load(msg)
  34.     setfenv(func,getfenv())
  35.     func()
  36.     rednet.send(id,msg)
  37.    end
  38.   end
  39.   sleep(0.1)
  40.  end
  41. end
  42.  
  43. function paralelos()
  44.  shell.run("Scouter")
  45. end
  46. parallel.waitForAny(main,escucha,paralelos)
Add Comment
Please, Sign In to add comment