您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
讓你可以更星爆
当前为
// ==UserScript== // @name MyKirito Helper // @version 0.2.6 // @description 讓你可以更星爆 // @author ganmaRRRRR // @match https://mykirito.com/* // @require https://cdn.jsdelivr.net/gh/CoeJoder/[email protected]/waitForKeyElements.js // @require https://unpkg.com/@popperjs/core@2 // @require https://unpkg.com/tippy.js@6 // @grant none // @run-at document-start // @namespace https://gf.qytechs.cn/users/600262 // ==/UserScript== const pkWinTable = [[25, 30, 32, 35, 50], [28, 45, 59, 54, 68], [62, 85, 97, 103, 133], [81, 120, 130, 140, 150]]; const pkLoseTable = [20, 35, 50, 60]; const actTable = ["15~19", "15", "13~19", "18", "18", "15", "15", "430", "820", "1610", "3200"]; const expTable = [0, 30, 60, 100, 150, 200, 250, 300, 370, 450, 500, 650, 800, 950, 1200, 1450, 1700, 1950, 2200, 2500, 2800, 3100, 3400, 3700, 4000, 4400, 4800, 5200, 5600, 6000, 6500, 7000, 7500, 8000, 8500, 9100, 9700, 10300, 11000, 11800, 12600, 13500, 14400, 15300, 16200, 17100, 18000, 19000, 20000, 21000, 23000, 25000, 27000, 29000, 31000, 33000, 35000, 37000, 39000, 41000, 44000, 47000, 50000, 53000, 56000, 59000, 62000, 65000, 68000, 71000]; var myK; var otherK; //config var yuukiMod = false; var delay = 500; // 一些東西的延遲 (以防抓不到網頁元素) var inited = false; (async function() { 'use strict'; // 抓Ajax Event function ajaxEventTrigger(event) { let ajaxEvent = new CustomEvent(event, { detail: this }); window.dispatchEvent(ajaxEvent); } let oldXHR = window.XMLHttpRequest; function newXHR() { let realXHR = new oldXHR(); // this指向window realXHR.addEventListener('readystatechange', function() { ajaxEventTrigger.call(this, 'ajaxReadyStateChange'); }, false); return realXHR; } window.XMLHttpRequest = newXHR; window.addEventListener('ajaxReadyStateChange', function (e) { // 處理成功的Request if (e.detail.readyState === oldXHR.DONE && e.detail.status === 200) { ajaxEventHandler(e.detail.responseURL, JSON.parse(e.detail.response)); } }); waitForKeyElements("div#root > nav", init); })(); function init() { // Navbar置頂 (from https://gf.qytechs.cn/zh-TW/scripts/404006-kirito-tools) let root = document.querySelector("div#root"); let navbar = document.querySelector("div#root > nav"); let navbarHeight = navbar.offsetHeight; root.style.paddingTop = `calc(${navbarHeight}px + 18px)`; // height + margin bottom navbar.style.position = "fixed"; navbar.style.top = "0"; // 加上選單按鈕 let button = document.createElement("a"); button.className = "sc-fzqAui eoGDzK"; button.innerHTML = "插件設定"; button.id = "mykirito_helper"; navbar.insertBefore(button, navbar.lastChild); tippy(button, { placement: 'bottom', content: `<div style="text-align: center;">MyKirito Helper</div>`+ `<div><p><input type="checkbox" id="yuuki_mod" ${yuukiMod?'checked':''}> 牙紀整形 (測試中)</p>`+ `<input type="range" id="delay" min="100" max="5000" step="100" value="500"><p id="show_delay" style="display: inline;"></p>`+ `ms Delay<p>有問題請嘗試調大此值</p><p style="text-align: right;"><a href="https://gf.qytechs.cn/zh-TW/scripts/405599-mykirito-helper/feedback" target="_blank">回報問題</a></p>`, allowHTML: true, interactive: true, trigger: 'mouseenter focus click', onShown(instance) { if (!inited){ document.getElementById("show_delay").innerHTML = ` ${document.getElementById("delay").value}`; document.getElementById("yuuki_mod").addEventListener('input', () => { yuukiMod = document.getElementById("yuuki_mod").checked; }); document.getElementById("delay").addEventListener('input', () => { delay = document.getElementById("delay").value; document.getElementById("show_delay").innerHTML = ` ${document.getElementById("delay").value}`;}); } inited = true; }, }); // 要求通知權限 if (Notification.permission === 'default' || Notification.permission === 'undefined') { Notification.requestPermission(); } setInterval(giveYuukiBack, delay); } function ajaxEventHandler(url, response) { let page = window.location.pathname.split("/")[1]; if (url === "https://mykirito.com/api/my-kirito") { myK = response; } switch (page) { case "":// 我的桐人 myKirito(url, response); break; case "profile": // 別的桐人 otherKirito(url, response); break; } } function myKirito(url, response) { let act = new URL(url).pathname.split("/"); if (act[2] === "my-kirito") { switch (act[3]) { case undefined: // 自己的資料 setTimeout(updateExpReq, delay); setTimeout(updateTeam, delay); setTimeout(addTooltip, delay); break; case "teammate": // 隊伍資料 setTimeout(updateTeam, delay); break; case "doaction": // 行動 response = response.myKirito; setTimeout(updateExpReq, delay); break; } } function updateExpReq() { let expReq = document.getElementById("exp_require"); if (expReq == null) { waitForKeyElements("div#root table > tbody", addExpReq); expReq = document.getElementById("exp_require"); } let lv = response.lv; let exp = response.exp; expReq.innerHTML = expTable[lv] - exp; function addExpReq(table) { let tr = table.lastChild.cloneNode(true); tr.childNodes[0].innerHTML = "距離升級"; tr.childNodes[1].id = "exp_require"; tr.removeChild(tr.lastChild); tr.removeChild(tr.lastChild); table.appendChild(tr); } } function updateTeam() { let teamRef = document.getElementById("team_ref"); if (teamRef == null) { waitForKeyElements("div#root div > h3 ~ div ~ div ~ div", addTeamRef); teamRef = document.getElementById("team_ref"); } let teammateUID = response.teammateUID; let teammateName = response.teammate; if (teammateName === undefined) { teammateName = document.querySelector("div ~ div > input").value; } if (teammateUID) { teamRef.href = `/profile/${teammateUID}`; teamRef.innerHTML = teammateName; } else { teamRef.href = ""; teamRef.innerHTML = ""; } function addTeamRef(team) { let a = document.createElement("a"); a.id = "team_ref"; team.appendChild(a); } } function addTooltip() { let actButton = document.querySelectorAll("button"); try{ for (let i = actButton.length - 11; i < actButton.length; i++) { tippy(actButton[i], { delay: [250, 100], content: `${actTable[i - (actButton.length - 11)]} 經驗值`, }); } } catch(e) {} } } function otherKirito(url, response) { switch (url.split("/")[4]) { case "profile": // 別人的資料 otherK = response.profile; break; } if (myK !== undefined && otherK !== undefined) { setTimeout(showRattr, delay); setTimeout(addTooltip, delay); } function showRattr() { let btnDetail = document.querySelectorAll("button")[0]; let btnCompare = document.querySelectorAll("button")[1]; let rattrs = otherK.rattrs; let floor = otherK.floor; let achieveP = otherK.achievementPoints; btnSwitch(); btnDetail.addEventListener('click', () => {setTimeout(btnSwitch, delay)}); btnCompare.addEventListener('click', () => {setTimeout(btnSwitch, delay)}); function btnSwitch() { // 詳細資料 if (btnDetail.disabled) { let table = document.querySelector("div#root tbody"); let count = 3; for (let k in rattrs) { count++; if (rattrs[k] === 0) { continue; } let r = document.createElement("span"); r.className = "sc-fzoLsD fYZyZu"; r.innerHTML = ` (+${rattrs[k]})`; table.childNodes[count].childNodes[1].appendChild(r); } // 一些有的沒的 let tr = table.lastChild.cloneNode(true); tr.childNodes[0].innerHTML = "目前層數"; tr.childNodes[1].innerHTML = floor; tr.childNodes[2].innerHTML = "成就點數"; tr.childNodes[3].innerHTML = achieveP; table.appendChild(tr); } // 能力比對 else { let table = document.querySelector("div#root table ~ table > tbody"); let count = 5; for (let k in rattrs) { count++; if (rattrs[k] === 0) { continue; } let r = document.createElement("span"); r.className = "sc-fzoLsD fYZyZu"; r.innerHTML = ` (+${rattrs[k]})`; table.childNodes[count].childNodes[1].appendChild(r); } } } } function addTooltip() { let opponentLv = otherK.lv; let selfLv = myK.lv let mul; switch (otherK.color) { case 'black': mul = 1; break; case 'orange': mul = 1.4; break; case 'red': mul = 1.7; break; } otherK = undefined; let pkButton = document.querySelectorAll("button"); try{ let lvDiff = opponentLv - selfLv; for (let i = 2; i < 6; i++) { let text; if (lvDiff > 3) {text = `>${pkWinTable[i - 2][4]} / >${pkLoseTable[i - 2]}`;} else if (lvDiff < -1) {text = `<${pkWinTable[i - 2][0]} / <${pkLoseTable[i - 2]}`;} else {text = `${pkWinTable[i - 2][lvDiff + 1]} / ${pkLoseTable[i - 2]}`;} tippy(pkButton[i], { delay: [250, 100], content: `${text} 經驗值`, }); } } catch(e) {} } } function giveYuukiBack() { if (yuukiMod) { let pics = document.querySelectorAll("picture"); for (let i=0; i<pics.length; i++) { if(pics[i].childNodes[0].srcset.match('yuuki.s.webp')){ pics[i].removeChild(pics[i].childNodes[0]); pics[i].removeChild(pics[i].childNodes[0]); pics[i].childNodes[0].src = "https://i.imgur.com/VJyzROs.png"; } } for (let i=0; i<pics.length; i++) { if(pics[i].childNodes[0].srcset.match('yuuki.webp')){ pics[i].removeChild(pics[i].childNodes[0]); pics[i].removeChild(pics[i].childNodes[0]); pics[i].childNodes[0].src = "https://i.imgur.com/VWNyCjk.png"; } } } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址