title: How to terminate Lua script?
body: <p>How would I terminate a Lua script? Right now I'm having problems with exit(), and I don't know why. (This is more of a Minecraft ComputerCraft question, since it uses the APIs included.) Here is my code:</p>
  
  <pre><code>while true do
  
      if turtle.detect() then
  
          if turtle.getItemCount(16) == 64 then
  
              exit() --here is where I get problems
  
          end
  
          turtle.dig() --digs block in front of it
  
      end
  
  end
  </code></pre>