THEJean_Kevin

Energie

Jul 4th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. waitStart = true
  2. start =false
  3. stop = false
  4. local modem = peripheral.wrap("tile_blockcapacitorbank_name_10")
  5.  
  6. function Stop()
  7. while stop do
  8. redstone.setOutput("left", false)
  9. if modem.getEnergyStored() == modem.getMaxEnergyStored() then
  10. print("WaitStart")
  11. stop = false
  12. waitStart = true
  13. commands.exec("setblock 1602 11 -954 air")
  14. sleep(10)
  15. WaitStart()
  16. end
  17. sleep(5)
  18. end
  19. end
  20.  
  21.  
  22.  
  23. function Start()
  24. while start do
  25. redstone.setOutput("left", true)
  26. if modem.getEnergyStored() == 0 then
  27. print("stop")
  28. start = false
  29. stop = true
  30. Stop()
  31. end
  32. sleep(5)
  33. end
  34. end
  35.  
  36. function WaitStart()
  37. while waitStart do
  38. if redstone.getInput("top") then
  39. print("start")
  40. waitStart = false
  41. start = true
  42. Start()
  43. else
  44. redstone.setOutput("left", false)
  45. end
  46. sleep(5)
  47. end
  48. end
  49.  
  50. redstone.setOutput("bottom", false)
  51. WaitStart()
Advertisement
Add Comment
Please, Sign In to add comment