Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oldWrite = term.write
- function mcWrite( text )
- local colorPalets = {
- ["&0"] = colors.black,
- ["&1"] = colors.blue,
- ["&2"] = colors.green,
- ["&3"] = colors.cyan,
- ["&4"] = colors.red,
- ["&5"] = colors.magenta,
- ["&7"] = colors.lightGray,
- ["&8"] = colors.gray,
- ["&b"] = colors.lightGreen,
- ["&c"] = colors.red,
- ["&d"] = colors.pink,
- ["&e"] = colors.yellow,
- ["&f"] = colors.white,
- ["&r"] = colors.black,
- }
- for i=1,#text do
- local sCode = string.sub( text, i, i+1 )
- local sCode2 = string.sub( text, i-1, i )
- if colorPalets[ sCode ] then
- term.setBackgroundColour( colorPalets[ sCode ] )
- else
- if colorPalets[ sCode2 ] then else
- oldWrite( string.sub( text, i, i ) )
- end
- end
- end
- end
- term.write = mcWrite
Advertisement
Add Comment
Please, Sign In to add comment