Added documentation for what to do when game is frozen. Updated CONTRIBUTING.md section about bug reporting

This commit is contained in:
danielyxie
2018-10-24 20:40:07 -05:00
parent e0df6207c1
commit e2b77e7a27
3 changed files with 31 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
Game Frozen or Stuck?
=====================
Infinite Loop in NetscriptJS
----------------------------
If your game is frozen or stuck in any way, then the most likely culprit is an
infinitely running loop in :ref:`netscriptjs`. To get past the freezing, run the game with
`?noScripts` in the URL:
`https://danielyxie.github.io/bitburner/?noScripts <https://danielyxie.github.io/bitburner/?noScripts>`_
Then, to fix your script, make sure you have a sleep or any other timed function like `hack()` or
`grow()` in any infinite loops::
while(true) {
// This is an infinite loop that does something
...
await ns.sleep(1000); // Add a 1s sleep to prevent freezing
}
Bug
---
Otherwise, the game is probably frozen/stuck due to a bug. To report a bug, follow
the guidelines `here <https://github.com/danielyxie/bitburner/blob/master/CONTRIBUTING.md#reporting-bugs>`_.
+1 -1
View File
@@ -23,9 +23,9 @@ secrets that you've been searching for.
Terminal <terminal>
Coding Contracts <codingcontracts>
Keyboard Shortcuts <shortcuts>
Game Frozen or Stuck? <gamefrozen>
Changelog <changelog>
Indices and tables
==================