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

About mon.write

Started by libook, 19 July 2012 - 07:14 AM
libook #1
Posted 19 July 2012 - 09:14 AM
I was using the ComputerCraftv1.3.3 .
I want to print a string in the monitor.
My code:
mon.write("ni hao")
When I ran the program, I saw this :
m:1: attempt to index ? (a nil value)
Who can help me?
Grim Reaper #2
Posted 19 July 2012 - 10:22 AM
Please, for the sanity of yourself and the rest of this forum's users, read the wiki before asking any question: Wiki

Thank you very much on the behalf of all users in 'Ask a Pro'.
ComputerCraftFan11 #3
Posted 20 July 2012 - 12:23 AM
I was using the ComputerCraftv1.3.3 .
I want to print a string in the monitor.
My code:
mon.write("ni hao")
When I ran the program, I saw this :
m:1: attempt to index ? (a nil value)
Who can help me?


You have to define mon first.

On the top of the code, put this:

mon = peripheral.wrap("<side>")