Posted 01 May 2013 - 12:55 PM
Hi,
I'm getting a error (attempt to perform arithmetic __add on number and nil) that i can't punch out of the program. i will put a indicator on with line the error is in
PS sorry if the long line are hard to read I don't know how to make them easier on the eyes.
I'm getting a error (attempt to perform arithmetic __add on number and nil) that i can't punch out of the program. i will put a indicator on with line the error is in
PS sorry if the long line are hard to read I don't know how to make them easier on the eyes.
Spoiler
local objectPics = {
{
{
"88f88",
"8fff8",
"f8f8f",
"88f88",
"88f88"
},
{
"88f88",
"88f88",
"f8f8f",
"8fff8",
"88f88"
},
{
"888f8",
"88f88",
"8f888",
"88f88",
"888f8"
},
{
"8f888",
"88f88",
"888f8",
"88f88",
"8f888"
}
},
{
{
"88888",
"8f8f8",
"f888f",
"8f8f8",
"88888"
},
{
"fffff",
"ff888",
"f8f88",
"f88f8",
"8888f"
},
{
"f8f8f",
"8ff8f",
"ff888",
"888ff",
"ff8ff"
},
{
"88888",
"88f88",
"8fff8",
"88f88",
"88888"
}
},
{
{
"88888",
"f888f",
"f888f",
"8f8f8",
"88f88"
},
{
"88888",
"8f88f",
"888f8",
"8f8ff",
"8f8f8"
},
{
"88888",
"f8ff8",
"ff88f",
"f8888",
"f8888"
}
}
}
local colorPal = {}
for i=1,16 do
colorPal[string.sub("0123456789abcdef",i,i)] = 2^(i-1)
end
for actionRow=1,2 do
for actionObject=1,4 do
for picRow=1,5 do
for picPixel=1,5 do
term.setCursorPos((actionObject-1)*6+27+picPixel,(actionRow-1)*6+1+picRow)
term.setBackgroundColor(colorPal[string.sub(objectPics[actionRow][actionObject][picRow],picPixel,picPixel)])
write(" ")
end
end
end
end
for actionObject=1,3 do
for PicRow=1,5 do
for picPixel=1,5 do
term.setCursorPos((actionObject-1)*6+27+picPixel,(2)*6+1+picRow)------------------------------------------------------------------------------------------------------ERROR
term.setBackgroundColor(colorPal[string.sub(objectPics[3][actionObject][picRow],picPixel,picPixel)])
write(" ")
end
end
end