I revised your post to put the HTML code in a Code Block.
We cannot properly test your HTML code snippet because it is incomplete and non-functional.
But here is my best un-tested guess, which can serve as a starting point for you:
var scriptResults = 'TBD';
var btn = document.querySelector('button.btn.ui-draggable[type="roll"]');
if (btn) {
btn.click();
scriptResults = 'OK';
} else { scriptResults = '[ERROR] button.btn.ui-draggable was NOT found.'; }
scriptResults;