Advertisement
TwiXon4ik

Untitled

Oct 5th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. local c = require("component")
  2. local unicode = require("unicode")
  3. local holo = c.hologram
  4.  
  5. if not holo then error("This program reqiures holoram projector.") end
  6.  
  7.  
  8. local hologram = {}
  9.  
  10. ---------------------------------------
  11.  
  12. local symbols = {
  13. A = {
  14. {0, 0, 1, 0, 0},
  15. {0, 1, 0, 1, 0},
  16. {1, 0, 0, 0, 1},
  17. {1, 1, 1, 1, 1},
  18. {1, 0, 0, 0, 1},
  19. {1, 0, 0, 0, 1},
  20. {1, 0, 0, 0, 1},
  21. },
  22. }
  23.  
  24. local function clear()
  25. holo.clear()
  26. end
  27.  
  28. function hologram.drawSymbol(x, y, z, symbol, color)
  29. for j = 1, #symbol do
  30. for i = 1, #symbol[j] do
  31. if symbol[j][i] == 1 then
  32. holo.set(x + i - 1, y - j + 1, z, color)
  33. end
  34. end
  35. end
  36. end
  37.  
  38. function hologram.text(x, y, z, text, color)
  39. local length = unicode.len(text)
  40. local smeshenie = 0
  41. for i = 1, length do
  42. local sym = unicode.sub(text, i, i)
  43. smeshenie = smeshenie + 6
  44. end
  45. end
  46.  
  47.  
  48. ---------------------------------------
  49.  
  50. local args = {...}
  51. local scale = tonumber(args[1]) or 1
  52. local height = tonumber(args[2]) or 10
  53.  
  54. local date
  55.  
  56. holo.setScale(scale)
  57.  
  58. while true do
  59. holo.clear()
  60. date = os.date("%T")
  61. hologram.text(1, height, 24, date, 2)
  62. os.sleep(1)
  63. end
  64.  
  65. ---------------------------------------
  66.  
  67. return hologram
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement