gyakkun / Course Elect Hack Test

// ==UserScript==
// @name         Course Elect Hack Test
// @version      0.3.2
// @description  Try to elect the course with first-come-first-served condition. Bad for server (Maybe)
// @author       gyakkun
// @match        http*://uems.sysu.edu.cn/elect/s/courses?*
// @grant        none
// @updateURL https://openuserjs.org/src/scripts/gyakkun/Course_Elect_Hack_Test.user.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    //Enter the course ID you want to select below.
    //var courseID = [55000574172002, 16230004172002];
    var oldConfirm = window.confirm;
    var oldAlertConfirm = window.alert;
    window.alert = () => {return true;};
    window.confirm = () => {return true;};
    function myrefresh(){
        window.location.reload();
        //for(let ctr = 0; ctr<courseID.length; ctr++){
            //tmpSelector = ".uncheck.a-elect[jxbh=\'"+courseID[ctr]+"\']";
            $(".uncheck.a-elect[jxbh='55000574172002']").click();
        //}
    }
    setTimeout(myrefresh,10000);
    // Your code here...
})();