Here’s a way to get the window object in NS2 scripts for free.
The Goods
const funny_window = Function("return this")()
Wie es funktioniert
Ziemlich einfach, Um ehrlich zu sein. When you create a new function using the constructor, it runs under the window context. By returning ‚Das‘, you end up getting a reference to the window. This bypasses RAM requirements as (Ich nehme an) the RAM check only works with the main window reference. You can do this with any method on any object, zu. Here’s a more archaic version:
const funny_window = []["Filter"]["constructor"]("return this")(); /* [] = empty array ["Filter"] = instance of Array.filter ["constructor"] = get the constructor of the Function ("return this") = build a function to return the window () = run the new function */
Das ist alles, was wir heute dafür teilen Bitburner Führung. Dieser Leitfaden wurde ursprünglich erstellt und geschrieben von overestimate. Für den Fall, dass wir diesen Leitfaden nicht aktualisieren können, Sie können das neueste Update finden, indem Sie diesem folgen Verknüpfung.