Posted 07 January 2016 - 04:09 AM
I give up looking for it, I cannot find out how to draw the new smaller characters added in 1.76.
local function box(bc) -- Box drawing api by 3d6
if #bc ~= 8 then return false end
local a = {}
for i=1,8 do
a[i] = bc:sub(i,i)
end
for i=1,6 do
if not string.gmatch("01",a[i]) then return false end
a[i] = tonumber(a[i])
end
for i=7,8 do
if not string.gmatch("0123456789abcdef",a[i]) then return false end
a[i] = 2^tonumber(a[i],16)
end
if a[6] == 1 then
term.setBackgroundColor(a[7])
term.setTextColor(a[8])
else
term.setBackgroundColor(a[8])
term.setTextColor(a[7])
end
local c = 128
for i=1,5 do
if a[i] ~= a[6] then
c = c + 2^(i-1)
end
end
term.write(string.char(c))
return true
end
This function takes an 8 character string as instructions to draw a box drawing character. The first six are either 0 or 1, and control which color each "pixel" takes on, from left to right, top to bottom. The last two are the color codes in paint format, one for the background (0s) and one for the foreground (1s). I use this for most box-drawing situations.