Advertisement
JustinzocktYT

Opencomputers HBM 1.12.2 Minecraft rocketlaunch

Mar 10th, 2025 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local computer = require("computer")
  4.  
  5. local function delay(seconds)
  6. local deadline = computer.uptime() + seconds
  7. repeat
  8. computer.pullSignal(deadline - computer.uptime())
  9. until computer.uptime() >= deadline
  10. end
  11.  
  12. if not component.isAvailable("redstone") then
  13. print("Error: Redstone component not found!")
  14. return
  15. end
  16.  
  17. local redstone = component.redstone
  18.  
  19. print("Initiate 10-second launch sequence? (y/n)")
  20. local answer = io.read():lower():sub(1,1)
  21.  
  22. if answer ~= "y" then
  23. print("Launch aborted!")
  24. return
  25. end
  26.  
  27. print("Starting countdown...")
  28. for i = 10, 1, -1 do
  29. print(i .. "...")
  30. delay(1)
  31. end
  32.  
  33. print("LIFTOFF!")
  34. redstone.setOutput(sides.back, 15)
  35. delay(0.5)
  36. redstone.setOutput(sides.back, 0)
  37.  
  38. print("Launch sequence completed!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement