-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Spam Open Boxes📦
154 lines (148 loc) · 5.29 KB
/
Spam Open Boxes📦
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
(async (args) => {
let [box, amount] = args
var name = JSON.parse(atob(localStorage.token.split('.')[1])).name,
tokens = await fetch("https://api.blooket.com/api/users/tokens?name=" + name, {
headers: {
"referer": "https://www.blooket.com/",
"content-type": "application/json",
"authorization": localStorage.token
}
}),
price = ({
blizzard: 25,
spooky: 25,
aquatic: 25,
bot: 20,
space: 20,
breakfast: 15,
medieval: 15,
wonderland: 20
})[box],
opens = amount > Math.floor(tokens / price) ? Math.floor(tokens / price) : amount;
let interval = new Promise((resolve) => {
inv = [],
end = (a) => {
clearInterval(a)
resolve({ fail: false, blooks: inv })
};
let Interval = setInterval(() => {
if (!opens) return end(Interval)
fetch("https://api.blooket.com/api/users/unlockblook", {
headers: {
authorization: localStorage.token,
"content-type": "application/json;charset=UTF-8",
},
referrer: "https://www.blooket.com/",
body: JSON.stringify({ name, box }),
method: "PUT"
}).then(async (response) => {
if (response.status != 200) return end(Interval);
else inv.push(await response.json());
opens--;
if (!opens) return end(Interval)
}).catch((e) => end(Interval));
}, 128)
});
interval.then(async (x) => {
if (x.fail) return alert("You don't have enough coins to open this box!");
let count = {};
Promise.all(x.blooks).then(Blooks => {
Blooks.map(e => e.unlockedBlook).forEach((i) => {
count[i] = (count[i] || 0) + 1;
});
alert('Results:\n' + Object.entries(count).map(x => ` ${x[1]} ${x[0]}`).join('\n'));
blookValues = ({
Toast: 5,
Cereal: 5,
Yogurt: 5,
"Breakfast Combo": 5,
"Orange Juice": 5,
Milk: 5,
Waffle: 20,
Pancakes: 20,
"French Toast": 75,
Pizza: 75,
Elf: 5,
Witch: 5,
Wizard: 5,
Fairy: 5,
"Slime Monster": 5,
Jester: 20,
Dragon: 20,
Queen: 20,
Unicorn: 75,
King: 200,
"Two of Spades": 5,
"Eat Me": 5,
"Drink Me": 5,
Alice: 5,
"Queen of Hearts": 5,
Dormouse: 20,
"White Rabbit": 20,
"Cheshire Cat": 20,
Caterpillar: 75,
"Mad Hatter": 75,
"King of Hearts": 200,
Earth: 5,
Meteor: 5,
Stars: 5,
Alien: 5,
Planet: 20,
UFO: 20,
Spaceship: 75,
Astronaut: 200,
"Pink Astronaut": 300,
"Yellow Astronaut": 300,
"Black Astronaut": 300,
"Orange Astronaut": 300,
"Red Astronaut": 300,
"Brown Astronaut": 300,
"Green Astronaut": 300,
"Lil Bot": 5,
"Lovely Bot": 5,
"Angry Bot": 5,
"Happy Bot": 5,
Watson: 20,
"Buddy Bot": 20,
"Brainy Bot": 75,
"Mega Bot": 200,
"Old Boot": 5,
Jellyfish: 5,
Clownfish: 5,
Frog: 5,
Crab: 5,
Pufferfish: 20,
Blobfish: 20,
Octopus: 20,
Narwhal: 75,
"Baby Shark": 200,
Megalodon: 250,
Pumpkin: 5,
"Swamp Monster": 5,
Frankenstein: 5,
Vampire: 5,
Zombie: 20,
Mummy: 20,
Werewolf: 75,
Ghost: 200,
"Haunted Pumpkin": 300,
"Snow Globe": 5,
"Holiday Gift": 5,
"Hot Chocolate": 5,
"Holiday Wreath": 5,
"Gingerbread Man": 20,
"Gingerbread House": 20,
Snowman: 75,
"Santa Claus": 200,
"Frost Wreath": 300,
"Tropical Globe": 300
});
var totalValue = Number("0");
for (const [blook, quant] of Object.entries(count)) {
totalValue += (blookValues[blook]) * quant;
};
alert('Value of Blooks Unlocked: ' + totalValue);
});
});
})([((text) => text.charAt(0).toUpperCase() + text.slice(1))(prompt('What box do you want to open? (e.g. "Space") The limited boxes will not open if they are not available')), Number(prompt('How many boxes do you want to open?'))])