Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data = { ... }
- local tg = data[2]
- local g = peripheral.wrap(tg)
- g.clear()
- g.sync()
- local cols = {
- ["0"] = 0x1,
- ["1"] = 0x2,
- ["2"] = 0x4,
- ["3"] = 0x8,
- ["4"] = 0x10,
- ["5"] = 0x20,
- ["6"] = 0x40,
- ["7"] = 0x80,
- ["8"] = 0x100,
- ["9"] = 0x200,
- ["a"] = 0x400,
- ["b"] = 0x800,
- ["c"] = 0x1000,
- ["d"] = 0x2000,
- ["e"] = 0x4000,
- ["f"] = 0x8000,
- }
- if fs.exists(data[1]) == true then
- local file = fs.open(data[1], "r")
- local nchars = " "
- local schar = { }
- local line = 1
- while nchars ~= nil do
- nchars = file.readLine()
- schar = { }
- for i = 1, #nchars do
- table.insert(schar[i], string.sub(nchars, i, i))
- end
- for i = 1,#schar do
- if schar[i] ~= " " then
- g.addBox(i, line, 1, 1, cols[schar[i]], 0.2)
- end
- end
- line = line + 1
- end
- g.sync()
- end
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement