-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
97 lines (91 loc) · 2.47 KB
/
index.js
File metadata and controls
97 lines (91 loc) · 2.47 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const fs = require("fs");
const metadata = require("./metadata.json");
const _ = require("lodash");
const idList = [];
const priceList = [];
const uriList = [];
const slot = {
main_hand: [],
off_hand: [],
two_hand: [],
head: [],
neck: [],
wrists: [],
finger: [],
};
const basics = ["Stick", "Stone", "Coral", "Bone Shard"];
const mainHandTypes = [
"Dagger",
"Shortsword",
"Longsword",
"Scimitar",
"Hand Axe",
"Club",
...basics,
];
const offHandTypes = [
"Buckler",
"Kiteshield",
"Tower Shield",
"Dagger",
"Shortsword",
"Hand Axe",
...basics,
];
const twoHandTypes = [
"Longsword",
"Battleaxe",
"Pickaxe",
"Shortbow",
"Longbow",
"Compound Bow",
"Crossbow",
];
const headTypes = ["Crown"];
const neckTypes = ["Amulet"];
const wristsTypes = ["Bracelet"];
const fingerTypes = ["Ring"];
metadata.forEach((gear) => {
// console.log(gear);
// const price = gear.mint_price.split(" ")[0];
// priceList.push(`u${price}000000`);
// uriList.push(`"${gear.mint_id}"`);
const gearType = gear.attributes[0].value;
if (mainHandTypes.includes(gearType)) {
slot.main_hand.push(`u${gear.mint_id}`);
}
if (offHandTypes.includes(gearType)) {
slot.off_hand.push(`u${gear.mint_id}`);
}
if (twoHandTypes.includes(gearType)) {
slot.two_hand.push(`u${gear.mint_id}`);
}
if (headTypes.includes(gearType)) {
slot.head.push(`u${gear.mint_id}`);
}
if (neckTypes.includes(gearType)) {
slot.neck.push(`u${gear.mint_id}`);
}
if (wristsTypes.includes(gearType)) {
slot.wrists.push(`u${gear.mint_id}`);
}
if (fingerTypes.includes(gearType)) {
slot.finger.push(`u${gear.mint_id}`);
}
});
// fs.writeFileSync(`out/prices.txt`, priceList.join(" "));
// fs.writeFileSync(`out/uris.txt`, uriList.join(" "));
console.log("MH", slot.main_hand.length);
fs.writeFileSync(`out/slots/main_hand.txt`, slot.main_hand.join(" "));
console.log("OH", slot.off_hand.length);
fs.writeFileSync(`out/slots/off_hand.txt`, slot.off_hand.join(" "));
console.log("TH", slot.two_hand.length);
fs.writeFileSync(`out/slots/two_hand.txt`, slot.two_hand.join(" "));
console.log("H", slot.head.length);
fs.writeFileSync(`out/slots/head.txt`, slot.head.join(" "));
console.log("N", slot.neck.length);
fs.writeFileSync(`out/slots/neck.txt`, slot.neck.join(" "));
console.log("W", slot.wrists.length);
fs.writeFileSync(`out/slots/wrists.txt`, slot.wrists.join(" "));
console.log("F", slot.finger.length);
fs.writeFileSync(`out/slots/finger.txt`, slot.finger.join(" "));