zequan

Untitled

Jun 18th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 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) rs.setOutput("back", true)
  27. elseif input == '2' then
  28. redstone.setOutput("back", true)
  29. term.clear()
  30. shell.run("door")
  31. elseif input == '3' then
  32. term.setCursorPos(2,11)
  33. print "Locking the system"
  34. sleep(1)
  35. shell.run("startup")
  36. elseif input == '4' then
  37. term.setCursorPos(2,11)
  38. print "System shutdown detected"
  39. sleep(0.5)
  40. term.setCursorPos(2,12)
  41. print "[Closing/Locking door]"
  42. sleep(1)
  43. os.shutdown()
  44. end
  45. term.clear()
  46. shell.run("door")
Advertisement
Add Comment
Please, Sign In to add comment