Skip to content

Instantly share code, notes, and snippets.

@jimkang
Last active February 16, 2023 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimkang/3da6fbb90945d20cc7feb0c8230defd3 to your computer and use it in GitHub Desktop.
Save jimkang/3da6fbb90945d20cc7feb0c8230defd3 to your computer and use it in GitHub Desktop.
Console automation for roll-a-guy
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