Posted 04 July 2015 - 01:15 AM
Hi all I didnt see one when searching google, so I programmed one, and am posting it here for all to use, as you see fit. Still an alpha version, logic is quite plain and easy to understand. Might need a little modification to get working for your own purposes.
Spoiler
function SetOutput(rsOut, myColors)
redstone.setBundledOutput(rsOut, myColors)
end
function ParseCounter(numInput)
if numInput < 10 then
numInput = "0" .. numInput
leftnum = string.sub(tostring(numInput), 1, 1)
else
leftnum = string.sub(tostring(numInput), 1, 1)
end
rightnum = string.sub(tostring(numInput), 2, 2)
-- print(leftnum .. rightnum)
leftcolor = ParseCounterLeft(tonumber(leftnum))
rightcolor = ParseCounterRight(tonumber(rightnum))
xColor = colors.combine(leftcolor, rightcolor)
return xColor
end
function ParseCounterLeft(numInput)
if numInput == 0 then
xColor = colors.combine(colors.white, colors.orange, colors.magenta, colors.lightBlue, colors.yellow, colors.lime)
return xColor
elseif numInput == 1 then
xColor = colors.combine(colors.yellow, colors.lime)
return xColor
elseif numInput == 2 then
xColor = colors.combine(colors.lightBlue, colors.yellow, colors.pink, colors.orange, colors.white)
return xColor
elseif numInput == 3 then
xColor = colors.combine(colors.lightBlue, colors.yellow, colors.pink, colors.lime, colors.white)
return xColor
elseif numInput == 4 then
xColor = colors.combine(colors.magenta, colors.pink, colors.yellow, colors.lime)
return xColor
elseif numInput == 5 then
xColor = colors.combine(colors.lightBlue, colors.magenta, colors.pink, colors.lime, colors.white)
return xColor
elseif numInput == 6 then
xColor = colors.combine(colors.lightBlue, colors.magenta, colors.pink, colors.lime, colors.white, colors.orange)
return xColor
elseif numInput == 7 then
xColor = colors.combine(colors.lightBlue, colors.yellow, colors.lime, colors.magenta)
return xColor
elseif numInput == 8 then
xColor = colors.combine(colors.white, colors.orange, colors.magenta, colors.lightBlue, colors.yellow, colors.lime, colors.pink)
return xColor
elseif numInput == 9 then
xColor = colors.combine(colors.magenta, colors.lightBlue, colors.yellow, colors.lime, colors.pink, colors.white)
return xColor
else
xColor = colors.combine(colors.white, colors.orange, colors.magenta, colors.lightBlue, colors.yellow, colors.lime)
return xColor
end
end
function ParseCounterRight(numInput)
if numInput == 0 then
xColor = colors.combine(colors.lightGray, colors.cyan, colors.purple, colors.blue, colors.brown, colors.green)
return xColor
elseif numInput == 1 then
xColor = colors.combine(colors.brown, colors.green)
return xColor
elseif numInput == 2 then
xColor = colors.combine(colors.blue, colors.brown, colors.red, colors.cyan, colors.lightGray)
return xColor
elseif numInput == 3 then
xColor = colors.combine(colors.blue, colors.brown, colors.red, colors.green, colors.lightGray)
return xColor
elseif numInput == 4 then
xColor = colors.combine(colors.purple, colors.red, colors.brown, colors.green)
return xColor
elseif numInput == 5 then
xColor = colors.combine(colors.blue, colors.purple, colors.red, colors.green, colors.lightGray)
return xColor
elseif numInput == 6 then
xColor = colors.combine(colors.blue, colors.purple, colors.red, colors.green, colors.lightGray, colors.cyan)
return xColor
elseif numInput == 7 then
xColor = colors.combine(colors.purple, colors.blue, colors.brown, colors.green)
return xColor
elseif numInput == 8 then
xColor = colors.combine(colors.lightGray, colors.cyan, colors.purple, colors.blue, colors.brown, colors.green, colors.red)
return xColor
elseif numInput == 9 then
xColor = colors.combine(colors.lightGray, colors.purple, colors.blue, colors.brown, colors.green, colors.red)
return xColor
else
xColor = colors.combine(colors.lightGray, colors.cyan, colors.purple, colors.blue, colors.brown, colors.green)
return xColor
end
end
local i = 0
for i = 0, 99, 1 do
SetOutput("back", ParseCounter(i))
-- print(ParseCounter(i))
sleep(1)
end