Last active
May 20, 2021 19:57
-
-
Save brunos3d/5b92b82b83b975edd07cb1e5e292259c to your computer and use it in GitHub Desktop.
Simple script that plays Kill the King automagically. https://codepen.io/jcoulterdesign/full/MWeZWxQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('div.game_intro__inner.start > p').click(); | |
setTimeout(() => { | |
document.querySelector('div.game_intro__inner.end > div > p.continue').click(); | |
var lastXp = 0; | |
function loop() { | |
var stage = parseInt(document.querySelector('div.ui > div > div.ui_progress__stage').innerText.slice(6)); | |
try { | |
var xp = parseInt(document.querySelector('div.game_inner__footer > div.resources > div').innerText.replace('xp', '')); | |
for (var idx = 1; idx <= 3; idx++) document.querySelector(`div.upgrades > div:nth-child(${idx}) > div`).click(); | |
if (lastXp <= 0) document.querySelector('div.nextPhase').click(); | |
lastXp = xp; | |
} catch { | |
document.body.onkeyup({ keyCode: 32 }); | |
} | |
setTimeout(loop, stage === 9 ? 350 : 1); | |
} | |
loop(); | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kill the King Beat Script
๐ค๐พ๐
Simple script that plays Kill the King automagically.
Instructions
Extras
Some extra scripts
Autoclick only
Infinite battle (bug)