您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
保存写过的题目答案,并自动填写。
当前为
// ==UserScript== // @name 浙江理工大学体育理论考试辅助脚本-自动记录、恢复-SL大法好 // @namespace https://eliotzhang.club // @homepage https://eliotzhang.club // @version 1.0 // @description 保存写过的题目答案,并自动填写。 // @author EliotZhang // @match http://tygl.zstu.edu.cn/* // @run-at document-end // ==/UserScript== (function () { 'use strict'; let EZ = '------浙理体育脚本 by EliotZhang------\n' let choice = ['A', 'B', 'C', 'D'] var titles = null var length = 0 function get_ans(k) { var st = titles[k].nextSibling.nextSibling var ans = '' while (st.style.length > 0) { if (st.firstChild.firstChild.checked) { ans = st.firstChild.firstChild.nextSibling.data.substr(2) break } st = st.nextSibling } return ans } function set_ans(k, ans) { var st = titles[k].nextSibling.nextSibling while (st.style.length > 0) { if (st.firstChild.firstChild.nextSibling.data.substr(2) === ans) { st.firstChild.firstChild.checked = true break } st = st.nextSibling } } function saveAns() { for (var i = 0; i < length; ++i) { var ans = get_ans(i) if (ans != '' && ans != undefined) { window.localStorage.setItem(titles[i].text, ans) } } } function loadAns() { for (var i = 0; i < length; ++i) { var ans = window.localStorage.getItem(titles[i].text) if (ans != null && ans != 'undefined') { set_ans(i, ans) } } } function main() { titles = $('a[id]') length = titles.length console.log(EZ, length) loadAns() setInterval(saveAns, 5000) } // Your code here... setTimeout(main, 5000) })();