-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkittens-bookmarklet.js
39 lines (38 loc) · 1.06 KB
/
kittens-bookmarklet.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
clearInterval(window.analystsInterval);
window.analystsInterval = setInterval(() => {
const resources = game.resPool.resources.filter((r) => r.unlocked);
const energy = [{
name: 'production',
value: game.resPool.energyProd,
}, {
name: 'consumption',
value: game.resPool.energyCons,
}];
const pollution = [{
name: 'raw',
value: game.bld.cathPollution,
}, {
name: 'ppt',
value: game.bld.cathPollutionPerTick,
}];
const village = [{
name: 'happiness',
value: game.village.happiness,
}];
const buildings = game.bld.meta[0].meta.filter((b) => b.unlocked).map(({ name, val }) => ({ name, value: val }));
fetch('http://localhost:9091/meow', {
method: 'PUT',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
at: Date.now(),
resources,
energy,
pollution,
village,
buildings,
}),
});
}, 2 * 1000);