Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local symtime = 0.05
- local maxreqtime = 2 --Максимальное время синхронизации
- local c = require("component")
- local s = require("sides")
- local r = c.redstone
- local l = tonumber(io.read())
- os.sleep(maxreqtime - (os.time()%maxreqtime)+1)
- while l>0 do
- --print(l)
- if l>99999999999999 then n=15
- elseif l>9999999999999 then n=14
- elseif l>999999999999 then n=13
- elseif l>99999999999 then n=12
- elseif l>9999999999 then n=11
- elseif l>999999999 then n=10
- elseif l>99999999 then n=9
- elseif l>9999999 then n=8
- elseif l>999999 then n=7
- elseif l>99999 then n=6
- elseif l>9999 then n=5
- elseif l>999 then n=4
- elseif l>99 then n=3
- elseif l>9 then n=2
- else n=1 end;
- l = l - 10^(n-1)
- r.setOutput(s.right,n)
- os.sleep(symtime)
- r.setOutput(s.right,0)
- os.sleep(symtime)
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement