Advertisement
TwiXon4ik

Untitled

Oct 5th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 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. {q, w, r, t, y},
  15. {q, w, r, t, y},
  16. {q, w, r, t, y},
  17. {q, w, r, t, y},
  18. {q, w, r, t, y},
  19. {q, w, r, t, y},
  20. {q, w, r, t, y},
  21.  
  22. },
  23. empty = {
  24. {0, 0, 0, 0, 0},
  25. {0, 0, 0, 0, 0},
  26. {0, 0, 0, 0, 0},
  27. {0, 0, 0, 0, 0},
  28. {0, 0, 0, 0, 0},
  29. {0, 0, 0, 0, 0},
  30. {0, 0, 0, 0, 0},
  31. },
  32. }
  33.  
  34. local function clear()
  35. holo.clear()
  36. end
  37.  
  38. function hologram.drawSymbol(x, y, z, symbol, color)
  39. for j = 1, #symbol do
  40. for i = 1, #symbol[j] do
  41. if symbol[j][i] == 1 then
  42. holo.set(x + i - 1, y - j + 1, z, color)
  43. end
  44. end
  45. end
  46. end
  47.  
  48. function hologram.text(x, y, z, text, color)
  49. local length = unicode.len(text)
  50. local smeshenie = 0
  51. for i = 1, length do
  52. local sym = unicode.sub(text, i, i)
  53. hologram.drawSymbol(x + smeshenie, y, z, symbols[sym], color)
  54. smeshenie = smeshenie + 6
  55. end
  56. end
  57.  
  58.  
  59. ---------------------------------------
  60.  
  61. local args = {...}
  62. local scale = tonumber(args[1]) or 1
  63. local height = tonumber(args[2]) or 10
  64.  
  65. local date
  66.  
  67. holo.setScale(scale)
  68.  
  69. while true do
  70. holo.clear()
  71. date = os.date("%T")
  72. hologram.text(1, height, 24, date, 2)
  73. os.sleep(1)
  74. end
  75.  
  76. ---------------------------------------
  77.  
  78. return hologram
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement