// ==UserScript== // @name SkipCeping-速通测评 // @namespace https://bbs.tampermonkey.net.cn/ // @version 1.0 // @description SkipCeping-速通测评 - 提供多种测评快速完成功能,包括性格测评和心理测评 // @author User // @match https://*.ceping.com/pc* // @grant none // ==/UserScript== (function () { "use strict"; let autoMode = false, autoTimer = null, currentTestType = null; function randomSelectPersonalityOptions() { try { const optionsContainer = document.querySelector(".ag9T7, .SK9xr"); if (!optionsContainer) { stopAutoMode(); return; } const options = optionsContainer.querySelectorAll(".qupWj"); if (options.length === 0) { stopAutoMode(); return; } const randomIndex1 = Math.floor(Math.random() * options.length); let randomIndex2; do { randomIndex2 = Math.floor(Math.random() * options.length); } while (randomIndex1 === randomIndex2); options[randomIndex1].click(); setTimeout(() => options[randomIndex2].click(), 300); setTimeout(clickConfirmButton, 1000); } catch (error) { stopAutoMode(); } } function randomSelectPsychologicalOptions() { try { const optionsContainer = document.querySelector(".aY-LL"); if (!optionsContainer) { stopAutoMode(); return; } const options = optionsContainer.querySelectorAll(".single-choice__item"); if (options.length === 0) { stopAutoMode(); return; } const randomIndex = Math.floor(Math.random() * options.length); options[randomIndex].click(); } catch (error) { stopAutoMode(); } } function autoExecute() { if (!autoMode || !currentTestType) return; if (currentTestType === "personality") { randomSelectPersonalityOptions(); } else if (currentTestType === "psychological") { randomSelectPsychologicalOptions(); } autoTimer = setTimeout(autoExecute, 2000); } function stopAutoMode() { autoMode = false; currentTestType = null; if (autoTimer) { clearTimeout(autoTimer); autoTimer = null; } const personalityToggle = document.getElementById("personality-toggle"); const psychologicalToggle = document.getElementById("psychological-toggle"); const statusText = document.getElementById("auto-mode-status"); if (personalityToggle) { personalityToggle.style.backgroundColor = "#d9d9d9"; personalityToggle.querySelector("div").style.transform = "translateX(2px)"; } if (psychologicalToggle) { psychologicalToggle.style.backgroundColor = "#d9d9d9"; psychologicalToggle.querySelector("div").style.transform = "translateX(2px)"; } if (statusText) { statusText.textContent = "自动模式:已停止"; statusText.style.color = "#ff4d4f"; } } function togglePersonalityMode() { if (currentTestType === "personality") { stopAutoMode(); return; } stopAutoMode(); autoMode = true; currentTestType = "personality"; const personalityToggle = document.getElementById("personality-toggle"); const slider = personalityToggle.querySelector("div"); const statusText = document.getElementById("auto-mode-status"); personalityToggle.style.backgroundColor = "#52c41a"; slider.style.transform = "translateX(26px)"; statusText.textContent = "自动模式:性格测评"; statusText.style.color = "#52c41a"; autoExecute(); } function togglePsychologicalMode() { if (currentTestType === "psychological") { stopAutoMode(); return; } stopAutoMode(); autoMode = true; currentTestType = "psychological"; const psychologicalToggle = document.getElementById("psychological-toggle"); const slider = psychologicalToggle.querySelector("div"); const statusText = document.getElementById("auto-mode-status"); psychologicalToggle.style.backgroundColor = "#52c41a"; slider.style.transform = "translateX(26px)"; statusText.textContent = "自动模式:心理测评"; statusText.style.color = "#52c41a"; autoExecute(); } function clickConfirmButton() { try { const confirmButton = document.querySelector( ".phoenix-button.btn_size.m_two_btn .phoenix-button__content" ); if (confirmButton) { const buttonWrapper = confirmButton.closest(".phoenix-button__wraper"); (buttonWrapper || confirmButton).click(); } else { stopAutoMode(); } } catch (error) { stopAutoMode(); } } function createControlPanel() { const panel = document.createElement("div"); panel.id = "skip-ceping-panel"; panel.innerHTML = `