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

[Lua] [Error?] Color problems

Started by chicka123, 23 November 2012 - 02:59 AM
chicka123 #1
Posted 23 November 2012 - 03:59 AM
For some reason, my monitor doesn't turn blue when I tell it to.
Code:
m = peripheral.wrap("top")
m.write("Meep")
sleep(10)
m.write(".-.")
sleep(10)
m.clear()
m.setBackgroundColor(colors.blue)
sleep(10)
os.shutdown()

NOTE**: It doesn't return any error
remiX #2
Posted 23 November 2012 - 04:35 AM
Can you even change the background colour of a terminal?
billysback #3
Posted 23 November 2012 - 04:37 AM
try slowing down the sleeps for testing purposes, to 0.5 maybe.
Lyqyd #4
Posted 23 November 2012 - 04:38 AM
setBackgroundColor sets the background color for subsequent text. You set it to blue, then don't write anything else. It doesn't magically change the whole screen to blue (which would be extraordinarily annoying). Try adding an m.clear() after it if you're looking to turn the whole background blue.