Advertisement
Guest User

control

a guest
Jun 25th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. --[[
  2. Bottom = Closed Sign
  3.  
  4. Back = Lights
  5. --]]
  6.  
  7. term.setCursorPos(1,1)
  8. term.clear()
  9.  
  10. local Sign = false
  11. local Light = false
  12. local Input
  13.  
  14. while true do
  15.  
  16. term.setCursorPos(1, 1)
  17. term.clear()
  18.  
  19. print("Please enter light on/off or sign on/off")
  20.  
  21. Input = read()
  22.  
  23. if Input == "sign on" then
  24. Sign = true
  25. end
  26.  
  27. if Input == "sign off" and Sign == true then
  28. Sign = false
  29. end
  30.  
  31. if Input == "light on" and Light == false then
  32. Light = true
  33. end
  34.  
  35. if Input == "light off" and Light == true then
  36. Light = false
  37. end
  38.  
  39. if Input == "exit" then
  40. break
  41. end
  42.  
  43.  
  44. if Sign == true then
  45. rs.setOutput("bottom", true)
  46. else
  47. rs.setOutput("bottom", false)
  48. end
  49.  
  50. if Light == true then
  51. rs.setOutput("back", true)
  52. else
  53. rs.setOutput("back", false)
  54.   end
  55.   print("Working...")
  56.   sleep(1.5)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement