Minecraft Galacticraft Airlock controll using ComputerCraft


SUBMITTED BY: Guest

DATE: Sept. 23, 2013, 5:20 a.m.

FORMAT: Text only

SIZE: 665 Bytes

HITS: 1931

  1. local open = false
  2. local dlock = "bottom"
  3. local dsafe = "back"
  4. redstone.setBundledOutput(dlock, 1)
  5. redstone.setOutput(dsafe, true)
  6. while true do
  7. local pe1, pe2 = os.pullEvent()
  8. if(pe1 == "monitor_touch") then
  9. print(pe2)
  10. if(open == false) then
  11. redstone.setBundledOutput(dlock, 3)
  12. sleep(2)
  13. redstone.setBundledOutput(dlock, 2)
  14. open = true
  15. elseif(open == true) then
  16. redstone.setBundledOutput(dlock, 3)
  17. sleep(2)
  18. redstone.setBundledOutput(dlock, 1)
  19. open = false
  20. end
  21. elseif(pe1=="mouse_click") then
  22. redstone.setOutput(dsafe, false)
  23. redstone.setBundledOutput(dlock, 0)
  24. os.shutdown()
  25. end
  26. end

comments powered by Disqus