Skip to content

Instantly share code, notes, and snippets.

@jimkang
Last active February 16, 2023 02:38
Show Gist options
  • Select an option

  • Save jimkang/3da6fbb90945d20cc7feb0c8230defd3 to your computer and use it in GitHub Desktop.

Select an option

Save jimkang/3da6fbb90945d20cc7feb0c8230defd3 to your computer and use it in GitHub Desktop.

Revisions

  1. jimkang revised this gist Feb 16, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion roll-until-you-get-it.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,6 @@
    function getYourClass(targetClass) { document.getElementById('roll-button').click(); setTimeout(() => { if (document.getElementById('class').textContent !== targetClass) { window.requestAnimationFrame(() => getYourClass(targetClass)); }}, 0) }
    getYourClass('Ranger')
    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)
  2. jimkang revised this gist Feb 16, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion roll-until-you-get-it.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    function getYourClass(targetClass) { document.getElementById('roll-button').click(); setTimeout(() => { if (document.getElementById('class').textContent !== targetClass) { window.requestAnimationFrame(() => getYourClass(targetClass)); }}, 0) }
    getYourClass('Ranger")
    getYourClass('Ranger')
  3. jimkang created this gist Feb 16, 2023.
    2 changes: 2 additions & 0 deletions roll-until-you-get-it.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    function getYourClass(targetClass) { document.getElementById('roll-button').click(); setTimeout(() => { if (document.getElementById('class').textContent !== targetClass) { window.requestAnimationFrame(() => getYourClass(targetClass)); }}, 0) }
    getYourClass('Ranger")