MCPcopy Create free account
hub / github.com/Revadike/Misc-JavaScript-Projects / pickGhost

Function pickGhost

DIM - Auto Ghost Switcher.user.js:22–73  ·  view source on GitHub ↗
(ghosts, o_area)

Source from the content-addressed store, hash-verified

20 "use strict";
21
22 function pickGhost(ghosts, o_area) {
23 var area = o_area.toLowerCase();
24 var ghost = ghosts.default;
25
26 switch (true) {
27 case area.includes("edz"):
28 case area.includes("earth"):
29 ghost = ghosts.edzplus || ghosts.edz || ghosts.default;
30 break;
31 case area.includes("titan"):
32 ghost = ghosts.titanplus || ghosts.titan || ghosts.default;
33 break;
34 case area.includes("nessus"):
35 ghost = ghosts.nessusplus || ghosts.nessus || ghosts.default;
36 break;
37 case o_area.includes("Io"):
38 ghost = ghosts.ioplus || ghosts.io || ghosts.default;
39 break;
40 case area.includes("mercury"):
41 ghost = ghosts.mercuryplus || ghosts.mercury || ghosts.default;
42 break;
43 case area.includes("mars"):
44 case area.includes("hellas basin"):
45 ghost = ghosts.marsplus || ghosts.mars || ghosts.default;
46 break;
47 case area.includes("tangled shore"):
48 ghost = ghosts.tangledplus || ghosts.tangled || ghosts.default;
49 break;
50 case area.includes("dreaming city"):
51 ghost = ghosts.dreamingplus || ghosts.dreaming || ghosts.default;
52 break;
53 case area.includes("vanguard"):
54 case area.includes("strike"):
55 ghost = ghosts.strikesplus || ghosts.strike || ghosts.default;
56 break;
57 case area.includes("crucible"):
58 ghost = ghosts.crucibleplus || ghosts.crucible || ghosts.default;
59 break;
60 case area.includes("gambit"):
61 ghost = ghosts.gambitplus || ghosts.gambit || ghosts.default;
62 break;
63 case area.includes("leviathan"):
64 ghost = ghosts.leviathanplus || ghosts.leviathan || ghosts.default;
65 break;
66 case area.includes("moon"):
67 ghost = ghosts.moonplus || ghosts.moon || ghosts.default;
68 break;
69 }
70
71 console.log("Equipping ghost: " + ghost.name);
72 ghost.equip();
73 }
74
75 function getD2Area(doc) {
76 var elem = doc.querySelector(".rich_presence");

Callers 1

monitorInGameStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected