AdditionalPylons

printer_mono.lua

Jun 5th, 2026
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local function decode_num(n)
  2.     local c = "\x7f"
  3.     local r = ""
  4.     while n>0 do
  5.         if n%2==1 then r=r..c
  6.         else r=r.." " end
  7.         n=math.floor(n/2)
  8.     end
  9.     return r
  10. end
  11. local p = peripheral.find("printer")
  12. local n={}
  13. for m in string.gmatch(read(), "[^,]+") do
  14.     n[#n+1]=decode_num(m+0)
  15. end
  16. p.newPage()
  17. for y=1,21 do
  18.     p.setCursorPos(1,y)
  19.     p.write(n[y])
  20. end
  21. p.endPage()
  22.  
Advertisement
Add Comment
Please, Sign In to add comment