Posted 13 April 2014 - 04:22 PM
hello. can anyone help me with my CC program? pastebin.com/B0rTwu1x Error: startup:2: attempt to indez ? (a nill value).
Thank you in advanced.
Thank you in advanced.
m.paintutils.drawImage(Lo ,1 ,1)
for y=1,#Lo do
local tLine = Lo[y]
for x=1,#tLine do
if tLine[x] > 0 then
term.setBackgroundColor( tLine[x] )
term.setCursorPos( x + xPos - 1, y + yPos - 1 )
term.write(" ")
end
end
The error you're getting looks like it's from line 3, because line 2 is just fine. Was that a typo?m.paintutils.drawImage(Lo ,1 ,1)
Here's the problem. Sadly, you can't use paintutils on anything other than term (correct me if I'm wrong). So you're going to have to write your own drawImage function. The simplest way to do this is to copy the function from paintutils and modify it to suit your needs.
So replace that line with:for y=1,#Lo do local tLine = Lo[y] for x=1,#tLine do if tLine[x] > 0 then term.setBackgroundColor( tLine[x] ) term.setCursorPos( x + xPos - 1, y + yPos - 1 ) term.write(" ") end end