title: Lua "Attempt to index ? (a nil value)
body: <p>So my friend and I are trying to write a program for ComputerCraft (Minecraft Mod), which uses Lua as a programming language. I haven't done any Lua before and he's played around a bit with it. Basically, we're trying to clear a line of text with <code>m.clear()</code>, but I think that it may not know what <code>m</code>, is, even though I tried to define it.</p>
  
  <p>Sorry if the question is poorly worded, here's the code:</p>
  
  <pre><code>m = peripheral.wrap("right")
  m.write("Shutting down.")
  m.clear()
  sleep(.1)
  m.setcursorpos(1,1)
  print("Shutting Down..")
  </code></pre>
  
  <p>And the function of the rest of the code (which is just more of the same) I won't post, because the function of the program is to make it so that it'll add a <code>.</code> each time, if you understand what I mean. But, that's not the important part. :)</p>
  
  <p>Notes:
  I don't actually know what <code>peripheral.wrap("right")</code> means, it was taken from the ComputerCraft forums from another person's code (he also wanted to clear the screen).</p>