Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.side=5 --лево
- _G.delay=0.05
- _G.Qdebug=nil
- r=require('component').redstone
- arg={...}
- function wiew(n)
- return Qdebug and print(n)
- end
- function sendNum(n)
- n=tostring(n)
- wiew(n)
- for i=1,n:len() do
- pulse(tonumber(n:sub(i,i))+1)
- end
- end
- function pulse(n)
- r.setOutput(side,n)
- os.sleep(delay)
- r.setOutput(side,0)
- end
- if arg[1] then
- local f=io.open(arg[1])
- local l=f:lines()
- for c in l do
- for i=1,c:len() do
- local char=c:sub(i,i)
- sendNum(string.byte(char))
- pulse(12)
- end
- end
- f:close()
- else
- print([[Использование:send <Имя файла>]])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement