Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gangs.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async function mainLoop(ns) {
const myGangInfo = await getNsDataThroughFile(ns, 'ns.gang.getGangInformation()');
const thisLoopStart = Date.now();
if (!territoryTickDetected) { // Detect the first territory tick by watching for other gang's territory power to update.
const otherGangInfo = await getNsDataThroughFile(ns, 'ns.gang.getOtherGangInformation()'); // Returns dict of { [gangName]: { "power": Number, "territory": Number } }
const otherGangInfo = await getNsDataThroughFile(ns, 'ns.gang.getAllGangInformation()'); // Returns dict of { [gangName]: { "power": Number, "territory": Number } }
if (lastOtherGangInfo != null && JSON.stringify(otherGangInfo) != JSON.stringify(lastOtherGangInfo)) {
territoryNextTick = lastLoopTime + territoryTickTime;
territoryTickDetected = true;
Expand Down Expand Up @@ -512,7 +512,7 @@ async function waitForGameUpdate(ns, oldGangInfo) {
async function enableOrDisableWarfare(ns, myGangInfo) {
warfareFinished = Math.round(myGangInfo.territory * 2 ** 20) / 2 ** 20 /* Handle API imprecision */ >= 1;
if (warfareFinished && !myGangInfo.territoryWarfareEngaged) return; // No need to engage once we hit 100%
const otherGangs = await getNsDataThroughFile(ns, 'ns.gang.getOtherGangInformation()'); // Returns dict of { [gangName]: { "power": Number, "territory": Number } }
const otherGangs = await getNsDataThroughFile(ns, 'ns.gang.getAllGangInformation()'); // Returns dict of { [gangName]: { "power": Number, "territory": Number } }
let lowestWinChance = 1, totalWinChance = 0, totalActiveGangs = 0;
let lowestWinChanceGang = "";
for (const otherGang in otherGangs) {
Expand Down
3 changes: 2 additions & 1 deletion helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ function checkBackwardsCompatibility(ns, command) {
.replaceAll("cloud.deleteServer", "deleteServer")
.replaceAll("cloud.getServerNames", "getPurchasedServers")
.replaceAll("cloud.getServerLimit", "getPurchasedServerLimit")
.replaceAll("cloud.getRamLimit", "getPurchasedServerMaxRam");
.replaceAll("cloud.getRamLimit", "getPurchasedServerMaxRam")
.replaceAll("getAllGangInformation", "getOtherGangInformation");

// Log altered commands to assist with troubleshooting.
if (alteredCommand != command)
Expand Down
Loading