Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local computer = require("computer")
- local function delay(seconds)
- local deadline = computer.uptime() + seconds
- repeat
- computer.pullSignal(deadline - computer.uptime())
- until computer.uptime() >= deadline
- end
- if not component.isAvailable("redstone") then
- print("Error: Redstone component not found!")
- return
- end
- local redstone = component.redstone
- print("Initiate 10-second launch sequence? (y/n)")
- local answer = io.read():lower():sub(1,1)
- if answer ~= "y" then
- print("Launch aborted!")
- return
- end
- print("Starting countdown...")
- for i = 10, 1, -1 do
- print(i .. "...")
- delay(1)
- end
- print("LIFTOFF!")
- redstone.setOutput(sides.back, 15)
- delay(0.5)
- redstone.setOutput(sides.back, 0)
- print("Launch sequence completed!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement