您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
给每一手牌后面添加天凤牌型分析连接
// ==UserScript== // @name 牌谱分析增强 // @namespace - // @version release-1.1 // @description 给每一手牌后面添加天凤牌型分析连接 // @author dkq // @match *://mjai.ekyu.moe/* // @icon - // @grant none // @run-at document-end // @license MIT // // ==/UserScript== (function() { 'use strict'; const prefix = 'https://tenhou.net/2/?q='; const formatPai = (pais) => { let arr = pais.match(/([0-9][mps]|[eswnpfc])/g); let ziPais = ' eswnpfc', result = '', curZi = '', preZi = ''; arr.forEach(pai => { if (pai.length == 1) { // zipai curZi = 'z'; if(curZi != preZi) { result += preZi; preZi = curZi; } result += ziPais.indexOf(pai); } else { // mps curZi = pai[1]; if(curZi != preZi) { result += preZi; preZi = curZi; } result += pai[0]; } }); result += curZi; return result; } const run = () => { let nodeList = document.querySelectorAll('.tehai-state'); nodeList.forEach(node => { let pais = ''; node.querySelectorAll(':scope > li').forEach(li => { if(!li.classList.contains('fuuro')) { let use = li.querySelector('use'); pais += use.getAttribute('href').match(/#pai-([0-9][mps]|[eswnpfc])/)[1]; } }); let qtext = formatPai(pais); let button = document.createElement('button'); button.textContent = '天凤分析'; button.addEventListener('click', () => { window.open(prefix + qtext); }); node.appendChild(button); }); }; run(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址