您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
none
// ==UserScript== // @name Tetrio Quick Profile Lookup // @namespace http://tampermonkey.net/ // @version 0.1 // @description none // @author username0554 (discord) // @license MIT // @match *://tetr.io/* // @icon https://www.google.com/s2/favicons?sz=64&domain=tetr.io // @grant none // ==/UserScript== let div = document.createElement("div"); div.id = "hud"; div.style = ` position: absolute; top: 20px; left: 20px; width:250px; height:auto; font: 20px HUN; background: black; z-index: 1000; color: white; text-align: center; padding: 10px; border-radius: 5px; ` div.innerHTML = ` <center> Quick Profile Lookup </center> <br> <button style="font: 20px HUN; background: black; color: white; border-radius: 3px; border: 2px solid grey;" id="profileFetch">Get profile (click here) </button> <br> <span id="profileName">?</span>'s profile <br> Current Rank: <img width="21" height="21" id="cRank" src="https://tetr.io/res/league-ranks/d.png"></img> <br> Peak Rank: <img width="21" height="21" id="pRank" src="https://tetr.io/res/league-ranks/d.png"></img> <br> APM: <span id="tAPM">0</span> APM <br> PPS: <span id="tPPS">0</span> PPS <br> 40L: <span id="40L">0:00</span> <br> BLITZ: <span id="BLTZ">1</span><br> Made by <a style="color: blue;">username0554</a>! `; document.body.appendChild(div); document.getElementById("profileFetch").addEventListener("click", function () { // BASIC USER DATA let name = window.prompt("username, lowercased") document.getElementById("profileName").innerHTML = name; fetch("https://ch.tetr.io/api/users/" + name).then(e => e.json()).then(function (e) { if(e.success) { document.getElementById("cRank").src = "https://tetr.io/res/league-ranks/" + e.data.user.league.rank + ".png" document.getElementById("pRank").src = "https://tetr.io/res/league-ranks/" + e.data.user.league.bestrank + ".png" document.getElementById("tAPM").innerHTML = e.data.user.league.apm; document.getElementById("tPPS").innerHTML = e.data.user.league.pps; document.getElementById("tPPS").innerHTML = e.data.user.league.pps; } else { alert("failed to fetch"); } }); //GAME RECORDS 40L, BLITZ fetch("https://ch.tetr.io/api/users/"+ name + "/records").then(e => e.json()).then(function (e) { if(e.success) { document.getElementById("40L").innerHTML = (function (str) { return str.substring(0, str.length - 3) + "." + str.substring(str.length-3); }(Math.round(e.data.records["40l"].record.endcontext.finalTime).toString())); document.getElementById("BLTZ").innerHTML = e.data.records.blitz.record.endcontext.score; } else { alert("failed to fetch"); } }); });