zequan

Untitled

Jun 18th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. -- IF YOU USE THIS FOR MY TUTORIAL SAVE THE FILE AS "door" WITHOUT EXTENSION
  2. -- DON'T TOUCH THE CODE IF YOU DON'T UNDERSTAND IT!
  3. -- IF YOU USE MY CODE AND RELEASE IT ATLREAST GIVE ME SOME CREDIT ^^
  4.  
  5. term.clear()
  6. term.setCursorPos(5,1)
  7. print "[Door Terminal]"
  8. term.setCursorPos(2,2)
  9. print "Please select an option"
  10. term.setCursorPos(2,3)
  11. print "[1] Open Door"
  12. term.setCursorPos(2,4)
  13. print "[2] Close Door"
  14. term.setCursorPos(2,5)
  15. print "[3] Lock system"
  16. term.setCursorPos(2,6)
  17. print "[4] Shutdown system"
  18. term.setCursorPos(2,8)
  19. write "Option: "
  20. input = read()
  21.  
  22. if input == '1' then
  23. redstone.setOutput("back", false)
  24. term.clear()
  25. shell.run("door")
  26. sleep(4)
  27. redstone.setOutput("back", true)
  28. term.clear()
  29. shell.run"door"
  30. elseif input == '2' then
  31. redstone.setOutput("back", true)
  32. term.clear()
  33. shell.run("door")
  34. elseif input == '3' then
  35. term.setCursorPos(2,11)
  36. print "Locking the system"
  37. sleep(1)
  38. redstone.setOutput("back", true)
  39. shell.run("startup")
  40. elseif input == '4' then
  41. term.setCursorPos(2,11)
  42. print "System shutdown detected"
  43. sleep(0.5)
  44. term.setCursorPos(2,12)
  45. print "[Closing/Locking door]"
  46. sleep(1)
  47. os.shutdown()
  48. end
  49. term.clear()
  50. shell.run("door")
Advertisement
Add Comment
Please, Sign In to add comment