prettierify
parent
55990778aa
commit
d755b72ce7
@ -1,138 +1,156 @@
|
|||||||
import webpack from "./webpack.js"
|
import webpack from "./webpack.js";
|
||||||
import { instead } from "./patcher.js"
|
import { instead } from "./patcher.js";
|
||||||
import { leak } from "./utils/memory.js"
|
import { leak } from "./utils/memory.js";
|
||||||
|
|
||||||
const sins = {
|
const sins = {
|
||||||
"Lust": null,
|
Lust: null,
|
||||||
"Pride": null,
|
Pride: null,
|
||||||
"Greed": null,
|
Greed: null,
|
||||||
"Wrath": null,
|
Wrath: null,
|
||||||
"Envy": null,
|
Envy: null,
|
||||||
"Gluttony": () => {
|
Gluttony: () => {
|
||||||
//slowly memory leak to make the app notably slower (perhaps even slothier)
|
//slowly memory leak to make the app notably slower (perhaps even slothier)
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
leak(6.66)
|
leak(6.66);
|
||||||
}, 500)
|
}, 500);
|
||||||
},
|
},
|
||||||
"Sloth": () => {
|
Sloth: () => {
|
||||||
//replace some influencial functions to make them wait time
|
//replace some influencial functions to make them wait time
|
||||||
instead(webpack.findByProps("_actionHandlers").__proto__, "dispatch", (args, orig) => {
|
instead(
|
||||||
let res;
|
webpack.findByProps("_actionHandlers").__proto__,
|
||||||
setTimeout(() => {
|
"dispatch",
|
||||||
res = orig(...args)
|
(args, orig) => {
|
||||||
}, 500)
|
let res;
|
||||||
while (!res) {}
|
setTimeout(() => {
|
||||||
return res
|
res = orig(...args);
|
||||||
})
|
}, 500);
|
||||||
}
|
while (!res) {}
|
||||||
}
|
return res;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rulers = {
|
const rulers = {
|
||||||
"Asmodeus": "Lust",
|
Asmodeus: "Lust",
|
||||||
"Lucifer": "Pride",
|
Lucifer: "Pride",
|
||||||
"Mammon": "Greed",
|
Mammon: "Greed",
|
||||||
"Satan": "Wrath",
|
Satan: "Wrath",
|
||||||
"Leviathan": "Envy",
|
Leviathan: "Envy",
|
||||||
"Beelzebub": "Gluttony",
|
Beelzebub: "Gluttony",
|
||||||
"Belphegor": "Sloth"
|
Belphegor: "Sloth"
|
||||||
}
|
};
|
||||||
|
|
||||||
function ritualFail(sin) {
|
function ritualFail(sin) {
|
||||||
if (Math.random() > 0.5) {
|
if (Math.random() > 0.5) {
|
||||||
//use generic failstates
|
//use generic failstates
|
||||||
//TODO: add nerd moxxie image and make it play the MLG clip on top of the screen and also make it patch sendMessage and replace every message with something funny idk i'll figure it out later
|
//TODO: add nerd moxxie image and make it play the MLG clip on top of the screen and also make it patch sendMessage and replace every message with something funny idk i'll figure it out later
|
||||||
throw `Illegal Invocation of a sin!`
|
throw `Illegal Invocation of a sin!`;
|
||||||
} else {
|
} else {
|
||||||
if (sin in sins) {
|
if (sin in sins) {
|
||||||
if (!sins[sin]) {
|
if (!sins[sin]) {
|
||||||
throw `Illegal Invocation of a sin!`
|
throw `Illegal Invocation of a sin!`;
|
||||||
} else {
|
} else {
|
||||||
sins[sin]()
|
sins[sin]();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("WTF did you do")
|
console.log("WTF did you do");
|
||||||
console.log(sin)
|
console.log(sin);
|
||||||
//window.location.reload()
|
//window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function findByRitual(incantation) {
|
function findByRitual(incantation) {
|
||||||
// I call upon the ___ of ___, ___, to ___ the ___ ___ with a ___ of name ___!
|
// I call upon the ___ of ___, ___, to ___ the ___ ___ with a ___ of name ___!
|
||||||
// I call upon the embodiment of lust, Asmodeus, to bring forth the imposing object with a property of name FluxDispatcher!
|
// I call upon the embodiment of lust, Asmodeus, to bring forth the imposing object with a property of name FluxDispatcher!
|
||||||
//TODO: should we do "I call upon the [great/almighty/etc].." instead of just "the"?
|
//TODO: should we do "I call upon the [great/almighty/etc].." instead of just "the"?
|
||||||
const args = incantation.split(" ")
|
const args = incantation.split(" ");
|
||||||
if (args.shift() !== "I" || args.shift() !== "call" || args.shift() !== "upon" || args.shift() !== "the") {
|
if (
|
||||||
ritualFail(sins[Math.floor(Math.random() * sins.length)])
|
args.shift() !== "I" ||
|
||||||
return
|
args.shift() !== "call" ||
|
||||||
}
|
args.shift() !== "upon" ||
|
||||||
const embodiment = args.shift()
|
args.shift() !== "the"
|
||||||
if (!(embodiment === "embodiment" || (embodiment === "king" && args.shift() === "sin"))) { //absolutely no clue where i heard them referred to as "king sin of X" before, but i think it sounds cool so i'll keep it
|
) {
|
||||||
//how did you even fuck this one up
|
ritualFail(sins[Math.floor(Math.random() * sins.length)]);
|
||||||
ritualFail(sins[Math.floor(Math.random() * sins.length)])
|
return;
|
||||||
return
|
}
|
||||||
}
|
const embodiment = args.shift();
|
||||||
if (args.shift() !== "of") {
|
if (
|
||||||
ritualFail(sin)
|
!(
|
||||||
}
|
embodiment === "embodiment" ||
|
||||||
const sin = args.shift().replace(",", "")
|
(embodiment === "king" && args.shift() === "sin")
|
||||||
if (!(sin in sins)) {
|
)
|
||||||
//invalid sin, so we can't use it
|
) {
|
||||||
ritualFail(sins[Math.floor(Math.random() * sins.length)])
|
//absolutely no clue where i heard them referred to as "king sin of X" before, but i think it sounds cool so i'll keep it
|
||||||
return
|
//how did you even fuck this one up
|
||||||
}
|
ritualFail(sins[Math.floor(Math.random() * sins.length)]);
|
||||||
const ruler = args.shift().replace(",", "")
|
return;
|
||||||
if (!(ruler in rulers)) {
|
}
|
||||||
//invalid ruler, so we still can't use it
|
if (args.shift() !== "of") {
|
||||||
//use the sin punishment
|
ritualFail(sin);
|
||||||
ritualFail(sin)
|
}
|
||||||
}
|
const sin = args.shift().replace(",", "");
|
||||||
if (rulers[ruler] !== sin) {
|
if (!(sin in sins)) {
|
||||||
//sin/ruler mismatch
|
//invalid sin, so we can't use it
|
||||||
//i feel it's more fitting to call the sin of the demon, instead of the sin you provided, as you would've angered the ruler for calling them for the wrong sin
|
ritualFail(sins[Math.floor(Math.random() * sins.length)]);
|
||||||
ritualFail(rulers[ruler])
|
return;
|
||||||
}
|
}
|
||||||
if (args.shift() !== "to") {
|
const ruler = args.shift().replace(",", "");
|
||||||
ritualFail(sin)
|
if (!(ruler in rulers)) {
|
||||||
}
|
//invalid ruler, so we still can't use it
|
||||||
if (args.shift() !== "summon") { //TODO: we want to accept either "summon" or "bring forth" here but i cbf rn
|
//use the sin punishment
|
||||||
ritualFail(sin)
|
ritualFail(sin);
|
||||||
}
|
}
|
||||||
if (args.shift() !== "the") {
|
if (rulers[ruler] !== sin) {
|
||||||
ritualFail(sin)
|
//sin/ruler mismatch
|
||||||
}
|
//i feel it's more fitting to call the sin of the demon, instead of the sin you provided, as you would've angered the ruler for calling them for the wrong sin
|
||||||
const adjective = args.shift()
|
ritualFail(rulers[ruler]);
|
||||||
if (adjective !== "imposing" && adjective !== "foreboding") { //TODO: sin-specific adjectives
|
}
|
||||||
ritualFail(sin)
|
if (args.shift() !== "to") {
|
||||||
}
|
ritualFail(sin);
|
||||||
const descriptor = args.shift()
|
}
|
||||||
if (descriptor !== "object" && descriptor !== "element") { //TODO: typecheck this shit
|
if (args.shift() !== "summon") {
|
||||||
ritualFail(sin)
|
//TODO: we want to accept either "summon" or "bring forth" here but i cbf rn
|
||||||
}
|
ritualFail(sin);
|
||||||
if (args.shift() !== "with" || args.shift() !== "a") {
|
}
|
||||||
ritualFail(sin)
|
if (args.shift() !== "the") {
|
||||||
}
|
ritualFail(sin);
|
||||||
const filter = args.shift()
|
}
|
||||||
if (filter !== "display" && filter !== "property") {
|
const adjective = args.shift();
|
||||||
ritualFail(sin)
|
if (adjective !== "imposing" && adjective !== "foreboding") {
|
||||||
}
|
//TODO: sin-specific adjectives
|
||||||
if (args.shift() !== "of" || args.shift() !== "name") {
|
ritualFail(sin);
|
||||||
ritualFail(sin)
|
}
|
||||||
}
|
const descriptor = args.shift();
|
||||||
//TODO: HOW THE FUCK ARE WE SUPPOSED TO DO MULTIPLE PROPS?
|
if (descriptor !== "object" && descriptor !== "element") {
|
||||||
const prop = args.shift().slice(0,-1)
|
//TODO: typecheck this shit
|
||||||
switch (filter) {
|
ritualFail(sin);
|
||||||
case "display":
|
}
|
||||||
return webpack.findByDisplayName(prop)
|
if (args.shift() !== "with" || args.shift() !== "a") {
|
||||||
break
|
ritualFail(sin);
|
||||||
case "property":
|
}
|
||||||
return webpack.findByProps(prop)
|
const filter = args.shift();
|
||||||
break
|
if (filter !== "display" && filter !== "property") {
|
||||||
default:
|
ritualFail(sin);
|
||||||
// the only way you can get here is with cosmic rays or divine intervention
|
}
|
||||||
ritualFail(sin)
|
if (args.shift() !== "of" || args.shift() !== "name") {
|
||||||
break
|
ritualFail(sin);
|
||||||
}
|
}
|
||||||
|
//TODO: HOW THE FUCK ARE WE SUPPOSED TO DO MULTIPLE PROPS?
|
||||||
|
const prop = args.shift().slice(0, -1);
|
||||||
|
switch (filter) {
|
||||||
|
case "display":
|
||||||
|
return webpack.findByDisplayName(prop);
|
||||||
|
break;
|
||||||
|
case "property":
|
||||||
|
return webpack.findByProps(prop);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// the only way you can get here is with cosmic rays or divine intervention
|
||||||
|
ritualFail(sin);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default findByRitual
|
export default findByRitual;
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
//memory leaker
|
//memory leaker
|
||||||
|
|
||||||
export function leak(mb) {
|
export function leak(mb) {
|
||||||
if (!window.beelzejuice) {
|
if (!window.beelzejuice) {
|
||||||
window.beelzejuice = {} //weird fanfic reference; i've seen this name used multiple times for alcoholic beverages
|
window.beelzejuice = {}; //weird fanfic reference; i've seen this name used multiple times for alcoholic beverages
|
||||||
}
|
}
|
||||||
const id = Math.random().toString(36).slice(2)
|
const id = Math.random().toString(36).slice(2);
|
||||||
window.beelzejuice[id] = new Uint8Array(Math.floor(mb * 1024 * 1024)).fill(666)
|
window.beelzejuice[id] = new Uint8Array(Math.floor(mb * 1024 * 1024)).fill(
|
||||||
return () => delete window.beelzejuice[id]
|
666
|
||||||
}
|
);
|
||||||
|
return () => delete window.beelzejuice[id];
|
||||||
|
}
|
||||||
|
Loading…
Reference in new issue