Last active
February 16, 2023 02:38
-
-
Save jimkang/3da6fbb90945d20cc7feb0c8230defd3 to your computer and use it in GitHub Desktop.
Console automation for roll-a-guy
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
function getYourClass(targetClass) { document.getElementById('roll-button').click(); setTimeout(() => { if (document.getElementById('class').textContent !== targetClass) { window.requestAnimationFrame(() => getYourClass(targetClass)); }}, 0) } | |
getYourClass('Ranger') | |
// Edit selector to check things other than strength. | |
function getYourScore(minScore) { document.getElementById('roll-button').click(); setTimeout(() => { if (+document.querySelector('.row:first-child .ability-score-column').textContent < minScore) { window.requestAnimationFrame(() => getYourScore(minScore)); }}, 0) } | |
getYourScore(16) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment