您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically extracts, analyzes, solves, and inputs answers in Mathspace
当前为
// ==UserScript== // @name Mathspace Ultimate Solver // @namespace http://tampermonkey.net/ // @version 5.0 // @description Automatically extracts, analyzes, solves, and inputs answers in Mathspace // @author You // @match *://*.mathspace.co/* // @grant none // @require https://cdnjs.cloudflare.com/ajax/libs/mathjs/11.9.0/math.min.js // ==/UserScript== (function() { 'use strict'; function getQuestionText() { let questionElement = document.querySelector('.math-question'); if (questionElement) { return questionElement.innerText.trim(); } return null; } function formatMathExpression(expression) { return expression .replace(/×/g, '*') // Convert multiplication .replace(/÷/g, '/') // Convert division .replace(/\^/g, '**') // Convert exponents .replace(/([a-zA-Z])(\d+)/g, '$1^$2') // Convert "n4" to "n^4" .replace(/(\d+)\s*\/\s*(\d+)/g, '($1/$2)'); // Convert fractions } function solveMathQuestion(expression) { try { let formattedExpression = formatMathExpression(expression); let answer = math.simplify(formattedExpression).toString(); return answer; } catch (error) { console.error("Error solving the equation:", error); return "Error"; } } function insertAnswer(answer) { let inputField = document.querySelector('input'); // Adjust selector if needed if (inputField) { inputField.value = answer; // Input the correct answer inputField.dispatchEvent(new Event('input', { bubbles: true })); // Simulate typing } else { console.log("Input field not found."); } } function processMathspaceQuestion() { let questionText = getQuestionText(); if (questionText) { console.log("Extracted Question:", questionText); let answer = solveMathQuestion(questionText); console.log("Correct Answer:", answer); alert("Correct Answer: " + answer); insertAnswer(answer); // Automatically input the answer } else { console.log("Could not find the question."); } } setTimeout(processMathspaceQuestion, 3000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址