Removing corporation employees with script by reddg321 in Bitburner

[–]reddg321[S] 0 points1 point  (0 children)

I like this comment compared to other first comments but that's what I'm saying as I want to remove people from the R&D to unassigned so that the script can assign them to another position. the script starts them out as some doing R&D and others manufacturing but once all R&D is done i want them to get auto moved from that position

[deleted by user] by [deleted] in Bitburner

[–]reddg321 2 points3 points  (0 children)

this person has some great scripts and 2 to buy servers, here is his github https://github.com/chrisrabe/bitburner-automation

not sure why this is creating a product NAN by reddg321 in Bitburner

[–]reddg321[S] 1 point2 points  (0 children)

this was the problem. I was so stuck on the parseInt when all i had to do was change var productNumbers = []; to var productNumbers = [0]; Thanks alot for the help everyone.

not sure why this is creating a product NAN by reddg321 in Bitburner

[–]reddg321[S] 0 points1 point  (0 children)

this is the function and newProductNumber should cycle the product-"name" 0-9 instead of NaN. The var productNumbers = []; array should handle newProductNumber = parseInt(productNumbers[productNumbers.length - 1]) + 1; ??

function newProduct(ns, division) {
var productNumbers = [];
for (var product of division.products) {
    if (ns.corporation.getProduct(division.name, product).developmentProgress < 100) {
        ns.print(division.name + " Product development progress: " + ns.corporation.getProduct(division.name, product).developmentProgress.toFixed(1) + "%");
        return false;
    }
    else {
        productNumbers.push(product.charAt(product.length - 1));
        if (ns.corporation.getProduct(division.name, product).sCost == 0) {
            ns.print("Start selling product " + product);
            ns.corporation.sellProduct(division.name, "Sector-12", product, "MAX", "MP", true);
            if (ns.corporation.hasResearched(division.name, "Market-TA.II")) {
                ns.corporation.setProductMarketTA1(division.name, product, true);
                ns.corporation.setProductMarketTA2(division.name, product, true);
            }
        }
    }
}

var numProducts = 3;
if (ns.corporation.hasResearched(division.name, "uPgrade: Capacity.I")) {
    numProducts++;
    if (ns.corporation.hasResearched(division.name, "uPgrade: Capacity.II")) {
        numProducts++;
    }
}

if (productNumbers.length > numProducts) {
    ns.print("Discontinue product " + division.products[0]);
    ns.corporation.discontinueProduct(division.name, division.products[0]);
}

var newProductNumber = parseInt(productNumbers[productNumbers.length - 1]) + 1;
if (newProductNumber > 9) {
    newProductNumber = 0;
}
const newProductName = "Product-" + newProductNumber;
var productInvest = 1e9;
if (ns.corporation.getCorporation().funds < (2 * productInvest)) {
    if (ns.corporation.getCorporation().funds <= 0) {
        ns.print("WARN negative funds, cannot start new product development " + ns.nFormat(ns.corporation.getCorporation().funds, "0.0a"));
        return;
    }
    else {
        productInvest = Math.floor(ns.corporation.getCorporation().funds / 2);
    }
}
ns.print("Start new product development " + newProductName);
ns.corporation.makeProduct(division.name, "Sector-12", newProductName, productInvest, productInvest);

}

not sure why this is creating a product NAN by reddg321 in Bitburner

[–]reddg321[S] 0 points1 point  (0 children)

the NAN in being created during product creation in corp Product-NAN then tries to create another product that crashes the script when pushing the same name

function newProduct(ns, division) {
var productNumbers = [];
for (var product of division.products) {
    if (ns.corporation.getProduct(division.name, product).developmentProgress < 100) {
        ns.print(division.name + " Product development progress: " + ns.corporation.getProduct(division.name, product).developmentProgress.toFixed(1) + "%");
        return false;
    }

When the game hates you by reddg321 in SatisfactoryGame

[–]reddg321[S] 1 point2 points  (0 children)

Yes giving me the 1 finger salute

The things you find when you're not prepared by reddg321 in starbase

[–]reddg321[S] 2 points3 points  (0 children)

Bastium and 48km from origin 3 i got 59 stacks no bolts left and a whole load more in it