Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pulses = 0
- function getPulses()
- while true do
- os.pullEvent 'redstone'
- if rs.getInput 'left' then
- pulses = pulses + 1
- repeat
- os.pullEvent 'redstone'
- until not rs.getInput 'left'
- pulses = 0
- end
- end
- end
- function waitForKeyword()
- while true do
- local input = read()
- if input == 'send' then
- for i=1, pulses do
- rs.setInput('right', true)
- sleep(0.1)
- rs.setInput('right', false)
- end
- end
- end
- end
- parallel.waitForAny(waitForKeyword, getPulses)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement