This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
3
Is there something wrong with ns.singularity.workForCompany(corp,false)
Post Flair (click to view more posts with a particular flair)
Post Body
So I have a script set up to work for corps till I have enough favour to unlock them as a faction. However it seems that the workForCompany function is taking focus even when false is passed as the focus variable. Am I doing something wrong here?
Code in case it's relevant:
const factions = [["ECorp","Aevum","Software"],["MegaCorp","Sector-12","Software"],["KuaiGong International","Chongqing","Software"],
["Four Sigma","Sector-12","Software"],["NWO","Volhaven","Software"],["Blade Industries","Sector-12","Software"],
["OmniTek Incorporated","Volhaven","Software"],["Bachman & Associates","Aevum","Software"],["Clarke Incorporated","Aevum","Software"],
["Fulcrum Secret Technologies","Aevum","Software"]];
const bitnodeCharismaReq = 275;
const bitnodeFactionReq = 200000;
/** @param {NS} ns */
export async function main(ns) {
ns.tail();
if (ns.args[0] == "simple"){
for (var i = 0; i < factions.length; i )
{
await doCorpSimp(ns, i);
}
}else{
if (ns.getPlayer.charisma < bitnodeCharismaReq){
await getCharisma(ns);
}
for (var i = 0; i < factions.length; i )
{
await doCorp(ns, i);
}
}
}
async function getCharisma(ns){
ns.print("traveling to city: Aevum");
ns.singularity.travelToCity("Aevum");
while (ns.getPlayer().charisma < bitnodeCharismaReq){
if (ns.singularity.isBusy()){
ns.toast("Want to train charisma, busy", "warning", 2000);
}else{
ns.singularity.universityCourse("summit university","Leadership course",false);
}
await ns.sleep(60000);
}
ns.singularity.stopAction();
}
async function doCorp(ns, corp){
var nextCorp = factions[corp];
ns.print("traveling to city: " nextCorp[1]);
ns.singularity.travelToCity(nextCorp[1]);
while (ns.singularity.applyToCompany(nextCorp[0], nextCorp[2])){ ns.print("Applied for job/promotion at " nextCorp[0]);await ns.sleep(1);}
while (ns.singularity.getCompanyRep(nextCorp[0]) < bitnodeFactionReq){
if (ns.singularity.isBusy()){
ns.toast("Ey, I'm working here", "warning", 2000);
ns.singularity.stopAction();
}
ns.singularity.workForCompany(nextCorp[0],false);
await ns.sleep(60000);
ns.singularity.stopAction();
while (ns.singularity.applyToCompany(nextCorp[0], nextCorp[2])){ ns.print("Applied for job/promotion at " nextCorp[0]);await ns.sleep(1);}
}
await awaitInvite(ns, corp);
ns.singularity.quitJob(nextCorp[0]);
}
async function doCorpSimp(ns, corp){
var nextCorp = factions[corp];
ns.print("traveling to city: " nextCorp[1]);
ns.singularity.travelToCity(nextCorp[1]);
while (ns.singularity.applyToCompany(nextCorp[0], nextCorp[2])){ ns.print("Applied for job/promotion at " nextCorp[0]);await ns.sleep(1);}
while (ns.singularity.getCompanyRep(nextCorp[0]) < bitnodeFactionReq){
if (ns.singularity.isBusy()){
ns.toast("Ey, I'm working here", "warning", 2000);
ns.singularity.stopAction();
}
ns.singularity.workForCompany(nextCorp[0],false);
while (ns.singularity.isBusy()){
await ns.sleep(6000);
}
while (ns.singularity.applyToCompany(nextCorp[0], nextCorp[2])){ ns.print("Applied for job/promotion at " nextCorp[0]);await ns.sleep(1);}
}
await awaitInvite(ns, corp);
ns.singularity.quitJob(nextCorp[0]);
}
async function awaitInvite(ns, corp){
var nextCorp = factions[corp];
ns.print("Awaiting invite to " nextCorp[0]);
while ( !ns.singularity.joinFaction(nextCorp[0]) && ns.singularity.getFactionRep(nextCorp[0]) < 2){
ns.print("Waiting for faction invite from " nextCorp[0]);
await ns.sleep(60000);
}
}
Author
Account Strength
90%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,103
Link Karma
455
Comment Karma
3,570
Profile updated: 1 week ago
Posts updated: 4 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Bitburner/c...