Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get the number of pulses from the user
- print("Enter the number of pulses:")
- local numPulses = tonumber(read())-1
- -- Validate user input
- if numPulses == nil or numPulses <= 0 then
- print("Invalid input. Please enter a positive number.")
- return
- end
- -- Function to emit a redstone pulse
- local function emitPulse()
- redstone.setOutput("right", true)
- sleep(0.5) -- Adjust this delay if needed
- redstone.setOutput("right", false)
- end
- -- Loop to emit the specified number of pulses
- for i = 1, numPulses do
- emitPulse()
- print("Pulse emitted: " .. i)
- if i < numPulses then
- print("Waiting 4 seconds until the next pulse...")
- sleep(4)
- end
- end
- print("Finished emitting pulses.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement