Advertisement
TwiXon4ik

Untitled

Oct 5th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 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 function clear()
  13. holo.clear()
  14. end
  15.  
  16. function hologram.drawSymbol(x, y, z, symbol, color)
  17. for j = 1, #symbol do
  18. for i = 1, #symbol[j] do
  19. if symbol[j][i] == 1 then
  20. holo.set(x + i - 1, y - j + 1, z, color)
  21. end
  22. end
  23. end
  24. end
  25.  
  26. function hologram.text(x, y, z, text, color)
  27. local length = unicode.len(text)
  28. local smeshenie = 0
  29. for i = 1, length do
  30. local sym = unicode.sub(text, i, i)
  31. smeshenie = smeshenie + 6
  32. end
  33. end
  34.  
  35.  
  36. ---------------------------------------
  37.  
  38. local args = {...}
  39. local scale = tonumber(args[1]) or 1
  40. local height = tonumber(args[2]) or 10
  41.  
  42. local date
  43.  
  44. holo.setScale(scale)
  45.  
  46. while true do
  47. holo.clear()
  48. date = os.date("%T")
  49. hologram.text(1, height, 24, date, 2)
  50. os.sleep(1)
  51. end
  52.  
  53. ---------------------------------------
  54.  
  55. return hologram
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement