This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DrCas's profile picture

Window 151: bios:80: error

Started by DrCas, 03 April 2016 - 05:31 PM
DrCas #1
Posted 03 April 2016 - 07:31 PM
I've created a code but it generates an error and shutsdown the computer afterwards. I don't know what's wrong but here it is:

term.setCursorPos(1, 1)
term.setBackgroundColor(colors.grey)
term.clear()
term.setCursorPos(1, 1)
term.setBackgroundColor(colors.blue)
term.clearLine()
term.setCursorPos(4, 1)
term.write("Welcome to CraneStation")
term.setCursorPos(1, 2)
term.write("Oxygen: .....")
term.setCursorPos(1, 3)
term.write("Be happy and enjoy your stay")

if redstone.getInput("left") == true then
term.setCursorPos(1, 2)
term.setBackgroundColor(colors.green)
term.write("Oxygen: OK					 ")
else
term.setCursorPos(1, 2)
term.setBackgroundColor(colors.red)
term.write("Oxygen: Error				  ")
end

The error I get is:
window:151: bios:80: bad argument: string expected, got nil

Anything I can do?
Dog #2
Posted 03 April 2016 - 07:38 PM
I *think* it's your colors.grey (line 2). IIRC it's either colors.gray or colours.grey (note the spelling)
Edited on 03 April 2016 - 05:38 PM
DrCas #3
Posted 03 April 2016 - 07:39 PM
I *think* it's your colors.grey (line 2). IIRC it's either colors.gray or colours.grey (note the spelling)
I knew it was that simple! Thanks!