Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1
- function reset()
- port.d = false
- port.c = false
- port.a = false
- interrupt(0.01, "play0")
- end
- function play()
- t = mem.msg
- if(t ~= nil) then
- for i=1, #t do
- if(t[i] == 97) then
- port.d = true
- elseif(t[i] == 98) then
- port.c = true
- elseif(t[i] == 99) then
- port.a = true
- end
- end
- end
- mem.msg = {}
- end
- if(event.type == "digiline" and event.channel == "ch_abc") then
- mem.msg = event.msg
- reset()
- elseif(event.iid == "play0") then
- play()
- end
Advertisement
Add Comment
Please, Sign In to add comment