Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = require("component")
- local unicode = require("unicode")
- local holo = c.hologram
- if not holo then error("This program reqiures holoram projector.") end
- local hologram = {}
- ---------------------------------------
- local function clear()
- holo.clear()
- end
- function hologram.drawSymbol(x, y, z, symbol, color)
- for j = 1, #symbol do
- for i = 1, #symbol[j] do
- if symbol[j][i] == 1 then
- holo.set(x + i - 1, y - j + 1, z, color)
- end
- end
- end
- end
- function hologram.text(x, y, z, text, color)
- local length = unicode.len(text)
- local smeshenie = 0
- for i = 1, length do
- local sym = unicode.sub(text, i, i)
- smeshenie = smeshenie + 6
- end
- end
- ---------------------------------------
- local args = {...}
- local scale = tonumber(args[1]) or 1
- local height = tonumber(args[2]) or 10
- local date
- holo.setScale(scale)
- while true do
- holo.clear()
- date = os.date("%T")
- hologram.text(1, height, 24, date, 2)
- os.sleep(1)
- end
- ---------------------------------------
- return hologram
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement