Advertisement
Cedricator

Reaktor Shell DoorOpener

Jun 11th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. --DoorOpener
  2.  
  3. tabID = multishell.getCurrent()
  4. multishell.setTitle(tabID,"DoorOpener")
  5.  
  6. local reactor
  7. reactor = peripheral.wrap("top")
  8.  
  9. function Toggle()
  10. status = rs.testBundledInput("bottom" ,colors.gray)
  11.  
  12. if status == true then
  13. rs.setBundledOutput("bottom" ,colors.subtract(rs.getBundledOutput("bottom"), colors.gray))
  14. else
  15. rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.gray))
  16.  
  17. end
  18. end
  19.  
  20. while true do
  21. if disk.isPresent("drive_0") == true then
  22. sleep(2)
  23. ident = disk.getID("drive_0")
  24. if ident == 5 then
  25. disk.eject("drive_0")
  26. Toggle()
  27. else
  28. disk.eject("drive_0")
  29. end
  30. else
  31. sleep(1)
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement