50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
|
/** @param {NS} ns */
|
||
|
export async function main(ns) {
|
||
|
ns.clearLog()
|
||
|
ns.tail()
|
||
|
ns.disableLog('sleep')
|
||
|
|
||
|
const START_SKILL_LEVEL = 80
|
||
|
const GYM_NAME = "powerhouse gym"
|
||
|
const FACTION = "Slum Snakes"
|
||
|
|
||
|
const skills = [
|
||
|
"strength",
|
||
|
"defense",
|
||
|
"dexterity",
|
||
|
"agility"
|
||
|
]
|
||
|
|
||
|
// skillup
|
||
|
for (const skill of skills) {
|
||
|
let player = ns.getPlayer()
|
||
|
if (player.skills[skill] < START_SKILL_LEVEL) {
|
||
|
ns.singularity.gymWorkout(GYM_NAME, skill, ns.singularity.isFocused())
|
||
|
while(player.skills[skill] < START_SKILL_LEVEL) {
|
||
|
await ns.sleep(1000)
|
||
|
player = ns.getPlayer()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// generate bad karma
|
||
|
ns.singularity.commitCrime("Homicide", ns.singularity.isFocused())
|
||
|
|
||
|
// join faction
|
||
|
if(!ns.getPlayer().factions.includes(FACTION)) {
|
||
|
while(!ns.singularity.checkFactionInvitations().includes(FACTION)) {
|
||
|
await ns.sleep(1000)
|
||
|
}
|
||
|
ns.singularity.joinFaction(FACTION)
|
||
|
}
|
||
|
|
||
|
// create gang
|
||
|
while(!ns.gang.inGang()) {
|
||
|
await ns.sleep(1000)
|
||
|
ns.gang.createGang(FACTION)
|
||
|
}
|
||
|
|
||
|
// Start gang management script
|
||
|
ns.singularity.commitCrime("Kidnap", ns.singularity.isFocused())
|
||
|
ns.spawn("/gang/gang-manage.js")
|
||
|
}
|