(() => {
if (window.daveBotRunning) return alert("King's Bot is already active.");
window.daveBotRunning = true;
// === GUI START ===
const gui = document.createElement("div");
gui.id = "daveGui";
gui.style = `
position:fixed;bottom:10px;right:10px;z-index:9999;
background:#0d0d0d;color:#0f0;padding:15px;
border:2px solid #0f0;font-family:monospace;
font-size:14px;max-width:300px;
`;
gui.innerHTML = `
💀 King Bot
`;
document.body.appendChild(gui);
let botRunning = false;
// === HACK CORE START ===
const cheatLogic = async () => {
const { stateNode } = Object.values((function react(r = document.querySelector("body>div")) {
return Object.values(r)[1]?.children?.[0]?._owner.stateNode ? r : react(r.querySelector(":scope>div"));
})())[1].children[0]._owner;
const Question = stateNode.state.question || stateNode.props.client?.question;
if (!Question) return;
const correctAnswers = Question.correctAnswers || [];
if (Question.qType !== "typing") {
if (stateNode.state.stage !== "feedback" && !stateNode.state.feedback) {
for (let i = 0; i < Question.answers.length; i++) {
if (correctAnswers.includes(Question.answers[i])) {
document.querySelectorAll("[class*='answerContainer']")[i]?.click();
break;
}
}
} else {
document.querySelector("[class*='feedback'], [id*='feedback']")?.firstChild?.click();
}
} else {
Object.values(document.querySelector("[class*='typingAnswerWrapper']"))[1].children._owner.stateNode.sendAnswer?.(correctAnswers[0]);
}
};
// === TICK HANDLER ===
const interval = setInterval(() => {
if (botRunning) cheatLogic();
}, 1500);
// === GUI HANDLERS ===
document.getElementById("daveStart").onclick = () => {
botRunning = true;
};
document.getElementById("daveStop").onclick = () => {
botRunning = false;
};
// ❌ Close Button
document.getElementById("daveClose").onclick = () => {
clearInterval(interval);
document.getElementById("daveGui")?.remove();
window.daveBotRunning = false;
};
// ` KEY TO TOGGLE GUI
document.addEventListener("keydown", e => {
if (e.key === "`") {
const gui = document.getElementById("daveGui");
if (gui) gui.style.display = gui.style.display === "none" ? "block" : "none";
}
});
})();