title: Why can't I have a main loop
body: <p>I've always written programs such that I have a main loop:</p>
  
  <pre><code>initialiseStuff();
  while(1){
      doRepetitiveStuff();
  }
  </code></pre>
  
  <p>But it seems that screeps will give me a "console not responding" error if I attempt this.</p>
  
  <p>Why does it do this? I'm guessing that the game waits for the end of your script before doing something perhaps?</p>
  
  <p>How can I achieve what I want (do some methods, set variables, only once) when the entire main is repeated every tick?</p>