49 lines
2.4 KiB
JavaScript
49 lines
2.4 KiB
JavaScript
/** @param {NS} ns */
|
|
export async function main(ns) {
|
|
|
|
const aOwnedAugmentations = ns.singularity.getOwnedAugmentations(true);
|
|
//ns.tprint("aOwnedAugmentations = " + aOwnedAugmentations);
|
|
const aFactions = ns.getPlayer().factions;
|
|
ns.tprint("aFactions = " + aFactions);
|
|
let aAugmentations;
|
|
let aStats;
|
|
|
|
for (let f = 0; f < aFactions.length; f++) {
|
|
//loop throught the factions
|
|
ns.tprint("Faction = " + aFactions[f]);
|
|
aAugmentations = ns.singularity.getAugmentationsFromFaction(aFactions[f]);
|
|
let aAvailableAugmentations = aAugmentations.filter(item => !aOwnedAugmentations.includes(item)); //ChatGPT
|
|
//ns.tprint("aAugmentations = " + aAugmentations);
|
|
ns.tprint("aAvailableAugmentations = " + aAvailableAugmentations);
|
|
|
|
|
|
ns.tprint("----------------------------------------------------------------------------------------------------------------------------------------------------------");
|
|
for (let a = 0; a < aAvailableAugmentations.length; a++) {
|
|
//loop throught their aumentations
|
|
//if (aOwnedAugmentations.includes(aAvailableAugmentations[a]) === false) {
|
|
|
|
//JSON.stringify(ns.singularity.getAugmentationStats(aAvailableAugmentations[a]));
|
|
let oStats = ns.singularity.getAugmentationStats(aAvailableAugmentations[a]);
|
|
ns.tprint(aAvailableAugmentations[a]);
|
|
let nAugmentationReputation = ns.singularity.getAugmentationRepReq(aAvailableAugmentations[a]);
|
|
let sAugmentationPrereq = ns.singularity.getAugmentationPrereq(aAvailableAugmentations[a]);
|
|
let nAugmentationPrice = ns.singularity.getAugmentationPrice(aAvailableAugmentations[a]);
|
|
ns.tprint("Reputation needed = " + nAugmentationReputation);
|
|
ns.tprint("Prereq = " + sAugmentationPrereq);
|
|
ns.tprint("Price = " + nAugmentationPrice);
|
|
// ChatGPT - Iterate through the object and display properties where the value is not 1
|
|
for (const key in oStats) {
|
|
if (oStats[key] !== 1) {
|
|
//console.log(`${key}: ${oStats[key]}`);
|
|
ns.tprint(`${key}: ${oStats[key]}`);
|
|
}
|
|
}
|
|
//ns.tprint(aAvailableAugmentations.filter(index !== 1) + " aStats = " + aStats);
|
|
//ns.tprint(aAvailableAugmentations[a] + " oStats = " + oStats);
|
|
ns.tprint("----------------------------------------------------------------------------------------------------------------------------------------------------------");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
} |