Skip to content

Instantly share code, notes, and snippets.

@ZhangYiJiang
Last active November 8, 2017 03:30
Show Gist options
  • Save ZhangYiJiang/1e96237906e0566524f925ff7c837c27 to your computer and use it in GitHub Desktop.
Save ZhangYiJiang/1e96237906e0566524f925ff7c837c27 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name IVLE LMS Quiz taker
// @namespace yijiang
// @version 0.1
// @description Completes IVLE LMS modules by randomly clicking on buttons
// @author Zhang Yijiang
// @match https://ivle.nus.edu.sg/Databank/LMS/*
// ==/UserScript==
(function(window){
const d = window.document;
setInterval(() => {
// Look for things that may be glowing
const glowing = d.querySelectorAll('#Stage div[class*="glow"], .Stage_blocker_id');
// Uncomment line below to debug
// if (glowing.length) console.log(glowing);
glowing.forEach((ele) => {
// Randomly click on 1/4 of the buttons on the screen
if (Math.random() > 0.25) ele.click();
});
}, 1000); // Repeat this every second
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment