Here’s a way to get the window object in NS2 scripts for free.
The Goods
const funny_window = Function("return this")()
How it Works
Pretty simple, para ser honesto. When you create a new function using the constructor, it runs under the window context. By returning ‘this’, you end up getting a reference to the window. This bypasses RAM requirements as (I presume) the RAM check only works with the main window reference. You can do this with any method on any object, também. Here’s a more archaic version:
const funny_window = []["filter"]["construtor"]("return this")(); /* [] = empty array ["filter"] = instance of Array.filter ["construtor"] = get the constructor of the Function ("return this") = build a function to return the window () = run the new function */
Isso é tudo o que estamos compartilhando hoje para isso Bitburner guia. Este guia foi originalmente criado e escrito por overestimate. Caso não atualizemos este guia, você pode encontrar a atualização mais recente seguindo este link.