Skip to content

Instantly share code, notes, and snippets.

@joemaller
Created October 6, 2022 14:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joemaller/984454486f935d929b0e6b28c4f287d4 to your computer and use it in GitHub Desktop.
bot for helping test online training. Kind of garbage, but maybe useful in the future.
/**
* For ADP's 2022 sexual harrassment training
*/
cr = () => {
const next = $('button.next-button:not(.disabled)')
if (next.length) {
next.click();
}
// const module = $('button.module-button')
// if (module.length) {
// module.sort(()=> (Math.random() - 0.5))[0].click()
// }
// const section = $('button.section-button:not(.complete)')
// if (section.length) {
// section.sort(()=> (Math.random() - 0.5))[0].click()
// }
$('button.ember-view.choice:not(.taken)').sort(()=> (Math.random() - 0.5))[0].click()
$('button.choice[data-ember-action]:not(.taken)').sort(()=> (Math.random() - 0.5))[0].click()
}
g = setInterval(cr, 300)
clearInterval(g)
function clickRandom(buttons) { buttons[Math.floor(Math.random() * buttons.length)].click()}
.module-button
.not('.button-container,.complete')
@joemaller
Copy link
Author

2023, just used these two:

nextClicker = setInterval(() => document.querySelector('button.next-button').click(), 1500)
choiceClicker = setInterval(()=> document.querySelectorAll('button.choice:not([disabled]):not(.taken)')[0].click(), 1500)

@ZeroSpree
Copy link

cp.jumpToSlide(91412) 😏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment