async function doSpendHashes(ns, spendOn) {
    // Make sure we have a decent amount of money ($100m) before spending hashes this way.
    if (ns.getPlayer().money > 100e6 && 9 in dictSourceFiles) {
        let spentHashes = 0;
        let shortName = spendOn;
        if (spendOn === 'Sell for Corporation Funds') shortName = '$1B of corporate funding';
        else if (spendOn === 'Exchange for Corporation Research') shortName = '1000 research for each corporate division';
        do {
            let numHashes = ns.hacknet.numHashes();
            ns.hacknet.spendHashes(spendOn);
            spentHashes = numHashes - ns.hacknet.numHashes();
            if (spentHashes > 0) log(ns, `  Spent ${nf(Math.round(spentHashes / 100) * 100)} hashes on ${shortName}`, 'success');
        } while (spentHashes > 0);
    }
}
/**
 * Spend hashes on something, as long as we have hacknet servers unlocked and a bit of money in the bank.
 * @param {NS} ns
 * @param {string} spendOn 'Sell for Corporation Funds' | 'Exchange for Corporation Research'
 */
Spend hashes on something, as long as we have hacknet servers unlocked and a bit of money in the bank.
@param {NS} ns
@param {string} spendOn 'Sell for Corporation Funds' | 'Exchange for Corporation Research'
Spend hashes on something as long as we have hacknet servers unlocked and a bit of money in the bank . @param { NS } ns @param { string } spendOn ' Sell for Corporation Funds ' | ' Exchange for Corporation Research '
async function doSpendHashes(ns, spendOn) {
    if (ns.getPlayer().money > 100e6 && 9 in dictSourceFiles) {
        let spentHashes = 0;
        let shortName = spendOn;
        if (spendOn === 'Sell for Corporation Funds') shortName = '$1B of corporate funding';
        else if (spendOn === 'Exchange for Corporation Research') shortName = '1000 research for each corporate division';
        do {
            let numHashes = ns.hacknet.numHashes();
            ns.hacknet.spendHashes(spendOn);
            spentHashes = numHashes - ns.hacknet.numHashes();
            if (spentHashes > 0) log(ns, `  Spent ${nf(Math.round(spentHashes / 100) * 100)} hashes on ${shortName}`, 'success');
        } while (spentHashes > 0);
    }
}
async function doSpendHashes ( ns , spendOn ) { if ( ns . getPlayer ( ) . money > 100e6 && 9 in dictSourceFiles ) { let spentHashes = 0 ; let shortName = spendOn ; if ( spendOn === 'Sell for Corporation Funds' ) shortName = '$1B of corporate funding' ; else if ( spendOn === 'Exchange for Corporation Research' ) shortName = '1000 research for each corporate division' ; do { let numHashes = ns . hacknet . numHashes ( ) ; ns . hacknet . spendHashes ( spendOn ) ; spentHashes = numHashes - ns . hacknet . numHashes ( ) ; if ( spentHashes > 0 ) log ( ns , ` ${ nf ( Math . round ( spentHashes / 100 ) * 100 ) } ${ shortName } ` , 'success' ) ; } while ( spentHashes > 0 ) ; } }
Spend hashes on something, as long as we have hacknet servers unlocked and a bit of money in the bank.
Spend hashes on something as long as we have hacknet servers unlocked and a bit of money in the bank .
// Make sure we have a decent amount of money ($100m) before spending hashes this way.
