Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inst = 'flute'
- spd = 2.5
- octave = 0
- i = 0
- local run = false
- local speaker = {}
- speaker = {peripheral.find("speaker")}
- function speakAll (pitch)
- for i=1, #speaker do
- speaker[i].playNote(inst, 3, pitch + octave)
- end
- end
- function alarm ()
- run = true
- speakAll(0)
- sleep(0.25 * spd)
- speakAll(4)
- sleep(0.25 * spd)
- speakAll(7)
- sleep(0.25 * spd)
- speakAll(12)
- run = false
- end
- while true do
- os.pullEvent("redstone")
- if (rs.getInput("bottom") and not run) then
- alarm ()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement