Posted 20 March 2013 - 08:21 AM
I've got a problem with my computercraft program, I always get an error Like this: "train |2| attempt to index (a nuber value?)" and/or
"train |22| attempt to index (a nuber value?)"
I've also tryed the decimal-code instead of colors.<color> but I won't work.. so now I have to ask a pro, whats wrong with my code.
! Please notice, I'm still in Minecraft 1.4.7, because I'm playing MindCrack !
And: Please excuse missplellings, I'm from Germany and not so good in english. ;)/>
"train |22| attempt to index (a nuber value?)"
I've also tryed the decimal-code instead of colors.<color> but I won't work.. so now I have to ask a pro, whats wrong with my code.
! Please notice, I'm still in Minecraft 1.4.7, because I'm playing MindCrack !
goal = "NPC-1"
colors = colors.combine(32)
rs.setBundledOutput("back", colors)
function DoNotStart()
term.setTextColor(colors.red)
print(" ")
print("Please don't drive!")
print(" ")
print("Incoming Train!")
colors = colors.subtract(colors, colors.lime)
rs.setBundledOutput("back", colors)
end
function AbleTS()
term.setTextColor(colors.lime)
print(goal)
colors = colors.combine(colors.lime)
rs.setBundledOutput("top", colors)
end
function checkH()
check = rs.getBundledInput("back")
if colors.test(check, colors.white) then
checkIn = 1
elseif not colors.test(check, colors.white) then
checkIn = 0
else
checkIn = 3
end
end
function printDir()
if checkIn == 1 then
DoNotStart()
elseif checkIn == 0 then
AbleTS()
else
error("Fatal error, please contact the .Admins.!")
end
end
while true do
sleep(0,5)
term.clear()
term.setCursorPos(1,1)
checkH()
printDir()
end
And: Please excuse missplellings, I'm from Germany and not so good in english. ;)/>
Edited on 20 March 2013 - 07:23 AM