Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sc(x, y)
- term.setCursorPos(x, y)
- end
- function clear(move)
- term.clear()
- if move ~= false then sc(1,1) end
- end
- function sb(color)
- term.setBackgroundColor(color)
- end
- function st(color)
- term.setTextColor(color)
- end
- function cCode(code)
- return 2 ^ tonumber(h, 16)
- end
- function toCode(n)
- return string.format('%x', n)
- end
- function cprint(text)
- local i = 0
- while true do
- i = i + 1
- if i > #text then break end
- local c = text:sub(i, i)
- if c == "\\" then
- if text:sub(i+1, i+1) == "&" then
- write("&")
- i = i + 1
- elseif text:sub(i+1, i+1) == "$" then
- write("$")
- i = i + 1
- else
- write(c)
- end
- elseif c == "&" then
- st(cCode(text:sub(i+1, i+1)))
- i = i + 1
- elseif c == "$" then
- sb(cCode(text:sub(i+1, i+1)))
- i = i + 1
- else
- write(c)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment