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

term.setBackgroundColor is not work.

Started by raxteeze, 12 June 2015 - 05:26 PM
raxteeze #1
Posted 12 June 2015 - 07:26 PM
The code is not working.
Error: window:57: Expected number


local cfg = fs.open('dconfig.db', 'r')
bcolor = cfg.readLine(1)
term.setBackgroundColor(bcolor)

file dconfig.db written "256"
Cranium #2
Posted 12 June 2015 - 07:45 PM
bcolor = tonumber(cfg.readLine(1))
You forgot to turn the result from a string to a number.
raxteeze #3
Posted 12 June 2015 - 07:54 PM
bcolor = tonumber(cfg.readLine(1))
You forgot to turn the result from a string to a number.
Thank you!