-
Notifications
You must be signed in to change notification settings - Fork 0
/
crew.js
56 lines (51 loc) · 1.22 KB
/
crew.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// 30 possible gang members
// create list of names
let memberNamePool = [
"Thor", // 1
"Iron Man", // 2
"Starlord", // 3
"Thanos", // 4
"Groot", // 5
"Ant-Man", // 6
"Wasp", // 7
"Spiderman", // 8
"Loki", // 9
"Gamora", // 10
"Rocket Raccoon", // 11
"T'Challa", // 12
"Vision", // 13
"Scarlet Witch", // 14
"Winter Soldier", // 15
"Black Widow", // 16
"Hulk", // 17
"Bruce Banner", // 18
"Hawkeye", // 19
"Captain Marvel", // 20
"War Machine", // 21
"Nick Fury", // 22
"Nebula", // 23
"Drax", // 24
"Deadpool", // 25
"Cable", // 26
"Quicksilver", // 27
"Wolverine", // 28
"Adam Warlock", // 29
"Yondu", //
]
function getRandomInt(max)
{
return Math.floor(Math.random() * Math.floor(max));
}
// /** @param {import(".").NS} ns **/
export async function main(ns)
{
ns.disableLog('ALL');
var members = ns.gang.getMemberNames();
while(ns.gang.canRecruitMember())
{
var possibleNames = memberNamePool.filter(name => !members.includes(name));
var toRecruit = possibleNames[getRandomInt(possibleNames.length)];
ns.gang.recruitMember(toRecruit);
await ns.sleep(1);
}
}