thor12022

Untitled

May 6th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. local hopper = 'right'
  2. local extractor = 'bottom'
  3. local locker = 'top'
  4. local engine = 'back'
  5. local state = 'disabled'
  6. redstone.setOutput(hopper, true)
  7. redstone.setOutput(engine, true)
  8. while true do
  9. if state == 'disabled' then
  10. if redstone.getInput(locker) == true then
  11. print('Items for processing')
  12. redstone.setOutput(hopper, false)
  13. redstone.setOutput(engine, false)
  14. state = 'enabled-starting'
  15. end
  16. elseif state == 'enabled-starting' then
  17. print('Waiting on extractor start')
  18. if redstone.getInput(extractor) == false then
  19. state = 'enabled'
  20. end
  21. elseif state == 'enabled' then
  22. if redstone.getInput(extractor) == true then
  23. print('Processing complete')
  24. redstone.setOutput(hopper, true)
  25. redstone.setOutput(engine, true)
  26. state = 'disabled'
  27. end
  28. end
  29. sleep(1)
  30. end
Advertisement
Add Comment
Please, Sign In to add comment