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

[Lua][Error] Getting a nil after wrapping peripheral.

Started by kaikalii, 30 December 2012 - 04:08 PM
kaikalii #1
Posted 30 December 2012 - 05:08 PM
I made a program for a simple digital clock, and it worked perfectly in the terminal itself.
However, when I changed to code to wrap it to a monitor above, I get an "attempt to call nil" error for line 9 despite the fact that my variables are clearly defined
All I changed was adding the top two lines and changing anything with "term." to "mon."
What am I doing wrong?

http://pastebin.com/uNPdhMyD
theoriginalbit #2
Posted 30 December 2012 - 05:34 PM
The monitor peripheral doesn't have a print function. Use write instead. (Line 9 of your code, it should have been saying the error on that line)