Advertisement
Guest User

startup

a guest
Aug 4th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.41 KB | None | 0 0
  1. function detect()
  2. paintutils.drawLine(1,1,51,1,colors.blue)
  3. paintutils.drawLine(1,2,51,2,colors.blue)
  4. paintutils.drawLine(1,3,51,3,colors.blue)
  5. term.setCursorPos(21,2)
  6. term.setTextColor(colors.red)
  7. term.setBackgroundColor(colors.blue)
  8. print("Code Lock")
  9. term.setCursorPos(1,4)
  10. term.setTextColor(colors.white)
  11. term.setBackgroundColor(colors.black)
  12. playerowned = "Nirawin29" -- pseudo du joueur autoriser
  13. rsside = "right" -- coter sortie redstone
  14. chat = peripheral.wrap("top") -- coter chatbox
  15. playd = peripheral.wrap("back") -- coter player detector
  16. Boucle = true
  17. y1=4
  18. y2=y1+2
  19. while Boucle do
  20.  paintutils.drawLine(1,5,51,5,colors.gray)
  21.  term.setCursorPos(22,5)
  22.  print("Logs")
  23.  term.setCursorPos(1,y1)
  24.  term.setBackgroundColor(colors.black)
  25.  print("En attente...")
  26.  term.setCursorPos(1,5)
  27.  e, player = os.pullEvent("player")
  28.  term.setCursorPos(1,y1)
  29.  term.clearLine()
  30.  term.setCursorPos(1,y2)
  31.   if player == playerowned then
  32.     chat.say("Bienvenue "..player,5)
  33.     rs.setOutput(rsside,true)
  34.     sleep(3)
  35.     rs.setOutput(rsside,false)
  36.     print(player.." a ouvert la porte")
  37.     y2=y2+1
  38.   else
  39.    chat.say("Bonjour "..player.." tu na pas la permissions d'ouvrir cette porte",5)
  40.    term.setCursorPos(1,y2)
  41.    print(player.." a voulus ouvrir la porte")
  42.   end
  43. end  
  44. end
  45. function deblock()
  46.   while Boucle do
  47.    e,key = os.pullEvent ("key")
  48.    if key == 200 then
  49.     pass()  
  50.    end
  51.   end
  52. end
  53. function pass()
  54.  i = 4
  55.   while  i == 18 do
  56.    term.setCursorPos(1,i)
  57.    term.clear()
  58.    paintutills.drawLine(1,i,51,i,colors.black)
  59.    i=i+1
  60.   end  
  61.  paintutils.drawLine(16,9,36,9,colors.gray)
  62.  paintutils.drawLine(16,11,36,11,colors.gray)
  63.  paintutils.drawPixel(16,10,colors.gray)
  64.  paintutils.drawPixel(36,10,colors.gray)
  65.  term.setCursorPos(17,10)
  66.  term.setBackgroundColor(colors.black)
  67.  write("Password:")
  68.  mdp = read("*")
  69.   if mdp == "1789" then
  70.    term.setCursorPos(17,10)
  71.    term.clearLine()
  72.    paintutils.drawPixel(16,10,colors.gray)
  73.    paintutils.drawPixel(36,10,colors.gray)
  74.    term.setCursorPos(18,10)
  75.    term.setBackgroundColor(colors.black)
  76.    commande = read()
  77.    sleep(1)
  78.    shell.run(commande)
  79.   else
  80.    os.reboot()
  81.   end
  82. end
  83. function copyright()
  84.  paintutils.drawLine(1,19,51,19,colors.red)
  85.  term.setCursorPos(17,19)
  86.  write("Copyright Nirawin29")
  87.  term.setBackgroundColor(colors.black)
  88.  term.setCursorPos(1,1)
  89. end
  90. term.clear()
  91. parallel.waitForAll(copyright,detect,deblock)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement