function randint(max) {
return Math.floor(Math.random * (max - 1));
}
(function () {
window.alert(
"This hack is made by ecc251 and is maintained by Forested Studios\nDo s to start the bot and e to stop it."
);
if (
window.confirm(
"According to this statement, you accept that we nor ecc521 are to blame if you get banned or punished."
)
) {
const localGetEventListeners = getEventListeners;
console.log(localGetEventListeners);
const sleep = (m) => new Promise((r) => setTimeout(r, m));
const upgradePrices = {
moneyPerQuestion: [
undefined,
10,
100,
1e3,
1e4,
7.5e4,
3e5,
1e6,
1e7,
1e8,
],
streakBonus: [
undefined,
15,
1.5e2,
1.5e3,
1.5e4,
115e3,
450e3,
15e5,
15e6,
2e8,
],
multiplier: [undefined, 50, 300, 2e3, 12e3, 85e3, 7e5, 65e5, 65e6, 1e9],
insurance: [undefined, 10, 250, 1e3, 25e3, 1e5, 1e6, 5e6, 25e6, 5e7],
};
const transporter = {};
transporter.toggleLoc = () => {
clickElement(
document.querySelector(
'div[style="font-weight: 900; cursor: pointer; font-size: 22px;"]'
)
);
};
transporter.toShop = () => {
clickElement(document.querySelectorAll("svg.MuiSvgIcon-root")[0]);
clickElement(
document.querySelectorAll(
"nav.MuiList-root.MuiList-padding svg.MuiSvgIcon-root"
)[1]
);
};
transporter.toQuestion = () => {
clickElement(document.querySelectorAll("svg.MuiSvgIcon-root")[0]);
clickElement(
document.querySelectorAll(
"nav.MuiList-root.MuiList-padding svg.MuiSvgIcon-root"
)[0]
);
};
transporter.simpleClick = clickElement;
console.log("Transporter: loaded");
function clickElement(elem) {
let events = [
"touchstart",
"touchend",
"mouseover",
"mousemove",
"mousedown",
"mouseup",
"click",
];
console.log(elem);
events.forEach((event) => {
if (event.includes("mouse") || event == "click") {
elem.dispatchEvent(
new MouseEvent("click", {
bubbles: true,
})
);
}
});
}
console.log("ClickElement: loaded");
let results = {};
function getMoney() {
return Number(
document
.querySelector("body > div > div")
.innerText.split(",")
.join("")
.split("\n")[0]
.slice(1)
);
}
console.log("GetMoney: loaded");
async function answerQuestion() {
transporter.toQuestion();
let elements = document.querySelectorAll("span.notranslate.lang-en");
console.log(elements);
questionName = elements[0].innerText;
index = 1;
if (results[questionName]) {
let answer = results[questionName];
for (let i = 1; i < elements.length; i++) {
if (elements[i].innerText == answer) {
index = i;
break;
}
}
}
console.log("[Async] AnswerQuestion: loaded");
let guessing = elements[index].innerText;
localGetEventListeners(document).click[0].listener({
isTrusted: true,
target: elements[index],
type: "click"
});
console.log(elements);
console.log(index);
console.log(guessing);
await sleep(450 + randint(50));
console.log(
document.querySelector(".fade-router-enter-done .animated.jello")
);
let lost = document
.querySelector(".fade-router-enter-done .animated.jello")
.innerText.startsWith("-");
if (!lost) {
results[questionName] = guessing;
let money = getMoney();
let shopIndex;
let moneyIndex = upgradePrices.moneyPerQuestion.findIndex((x) => {
return money >= x;
});
let streakIndex = upgradePrices.streakBonus.findIndex((x) => {
return money >= x;
});
let multiplierIndex = upgradePrices.multiplier.findIndex((x) => {
return money >= x;
});
let purchaseIndex;
if (moneyIndex != -1) {
shopIndex = 0;
purchaseIndex = moneyIndex;
upgradePrices.moneyPerQuestion[moneyIndex] = undefined;
} else if (streakIndex != -1) {
shopIndex = 1;
purchaseIndex = streakIndex;
upgradePrices.streakBonus[streakIndex] = undefined;
} else if (multiplierIndex != -1) {
shopIndex = 2;
purchaseIndex = multiplierIndex;
upgradePrices.multiplier[multiplierIndex] = undefined;
}
console.log(money);
console.log(shopIndex);
console.log(purchaseIndex);
console.log(moneyIndex, streakIndex, multiplierIndex);
if (shopIndex != undefined) {
transporter.toShop();
await sleep(400);
let options = document.querySelectorAll(
"body > div > div > div:nth-child(3) > div:nth-child(1) > div > div > div"
);
console.log(options);
transporter.simpleClick(options[shopIndex]);
await sleep(400);
let selections = document.querySelectorAll(
"body > div > div > div:nth-child(3) > div:nth-child(1) > div > div > div > div"
);
clickElement(selections[purchaseIndex + 3]);
await sleep(300);
transporter.simpleClick(selections[2]);
await sleep(300);
transporter.toQuestion();
} else {
transporter.toQuestion();
}
} else {
let viewCorrectAnswer = document.evaluate(
"//div[contains(text(),'View Correct Answer')]",
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;
transporter.simpleClick(viewCorrectAnswer);
await sleep(400);
let correctAnswer = document.querySelector(
"body > div > div > div:nth-child(3) > div:nth-child(1) > div > div > div > div > div:nth-child(3)"
).innerText;
results[questionName] = correctAnswer;
transporter.toQuestion();
}
await sleep(400);
}
let answering = false;
function stopAnswering() {
answering = false;
}
async function startAnswering() {
answering = true;
while (answering === true) {
await answerQuestion();
}
}
async function toggleAnswer() {
answering = !answering;
while (answering) {
await answerQuestion();
}
}
window.addEventListener("keyup", function (e) {
if (e.key == "s") {
startAnswering();
}
});
window.addEventListener("keyup", function (e) {
if (e.key == "e") {
stopAnswering();
}
});
console.log("Script loaded successfully");
} else {
}
})();