ReimarPB

ComputerCraft Special Characters

Dec 4th, 2020 (edited)
527
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script prints all special characters you can type in ComputerCraft
  2. -- These can be typed in Lua like this "\num" where num is a number from 0 - 255 (ex. "\141")
  3. -- Created by ReimarPB
  4.  
  5. -- To run:
  6. -- > pastebin get UnmwmDYp font
  7. -- > font
  8.  
  9. term.clear()
  10. term.setCursorPos(1, 1)
  11.  
  12. local width, height = term.getSize()
  13. local x = 1 -- The x position of our cursor
  14.  
  15. for i = 0, 255, 1 do
  16.    
  17.     -- Print numbers at the side and newlines
  18.     if x + 1 > width or x == 1 then
  19.  
  20.         if x > 1 then print("") end
  21.  
  22.         term.setTextColor(colors.lightGray)
  23.         term.write(string.format("%03d", i) .. " ")
  24.         term.setTextColor(colors.white)
  25.  
  26.         x = 4
  27.  
  28.     end
  29.  
  30.     -- Print the character
  31.     local char = loadstring("return \"\\" .. i .. "\"")()
  32.     term.write(char .. " ")
  33.  
  34.     x = x + 2
  35.  
  36. end
  37.  
  38. term.setCursorPos(1, height)
RAW Paste Data