mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
write()/read() now work for script files. You can now use angled brackets in tprint() (and create DOM elements). Added CodingContract implementation
This commit is contained in:
+14
-1
@@ -57,7 +57,7 @@ WorkerScript.prototype.getServer = function() {
|
||||
//Returns the Script object for the underlying script
|
||||
WorkerScript.prototype.getScript = function() {
|
||||
let server = this.getServer();
|
||||
for (var i = 0; i < server.scripts.length; ++i) {
|
||||
for (let i = 0; i < server.scripts.length; ++i) {
|
||||
if (server.scripts[i].filename === this.name) {
|
||||
return server.scripts[i];
|
||||
}
|
||||
@@ -66,6 +66,19 @@ WorkerScript.prototype.getScript = function() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Returns the Script object for the specified script
|
||||
WorkerScript.prototype.getScriptOnServer = function(fn, server) {
|
||||
if (server == null) {
|
||||
server = this.getServer();
|
||||
}
|
||||
for (let i = 0; i < server.scripts.length; ++i) {
|
||||
if (server.scripts[i].filename === fn) {
|
||||
return server.scripts[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
WorkerScript.prototype.shouldLog = function(fn) {
|
||||
return (this.disableLogs.ALL == null && this.disableLogs[fn] == null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user