noredinkhack

Clicks a button with ID 'nri-quiz-submit-button' every 500ms for 5 seconds. If not found, clicks 'try-similar-problem' instead.

当前为 2024-09-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         noredinkhack
// @version      0.7
// @description  Clicks a button with ID 'nri-quiz-submit-button' every 500ms for 5 seconds. If not found, clicks 'try-similar-problem' instead.
// @match        *://www.noredink.com/learn/quiz/*
// @grant        none
// @namespace https://greasyfork.org/users/1365527
// ==/UserScript==

(function() {
    'use strict';

    // Count of clicks for each button
    let submitButtonCount = 0;
    let trySimilarButtonCount = 0;

    // Function to click the buttons
    function clickButton() {
        // Try to select the button with ID 'nri-quiz-submit-button'
        const submitButton = document.getElementById('nri-quiz-submit-button');
        if (submitButton) {
            submitButton.click();
            submitButtonCount++;
            console.log(`'Submit answer' button clicked ${submitButtonCount} times`);
        } else {
            // If 'nri-quiz-submit-button' is not found, try the 'try-similar-problem' button
            const trySimilarButton = document.getElementById('try-similar-problem');
            if (trySimilarButton) {
                trySimilarButton.click();
                trySimilarButtonCount++;
                console.log(`'Try a similar problem' button clicked ${trySimilarButtonCount} times`);
            } else {
                console.log('Both buttons not found');
            }
        }
    }

    // Click the buttons every 500 milliseconds
    const intervalId = setInterval(clickButton, 500);

    // Stop clicking after 5 seconds
    setTimeout(() => {
        clearInterval(intervalId);
        console.log(`Stopped clicking. Total 'Submit answer' clicks: ${submitButtonCount}`);
        console.log(`Total 'Try a similar problem' clicks: ${trySimilarButtonCount}`);
    }, 5000); // 5000 milliseconds = 5 seconds
})();