florr.io | Shows current server you are in

Shows current server you are in

目前為 2023-03-03 提交的版本,檢視 最新版本

// ==UserScript==
// @name         florr.io | Shows current server you are in
// @namespace    https://github.com/Samer-Kizi
// @version      1.0.0
// @description  Shows current server you are in
// @author       Furaken
// @match        https://florr.io/*
// @grant        unsafeWindow
// ==/UserScript==

let url;
const nativeWebSocket = unsafeWindow.WebSocket;
unsafeWindow.WebSocket = function(...args){
    const socket = new nativeWebSocket(...args);
    url = socket.url
    return socket;
};

let cp6 = unsafeWindow.cp6
document.documentElement.addEventListener("keydown", function() {
    if (event.keyCode === 9) getServerId()
    else if (event.keyCode === 32 && event.shiftKey && event.ctrlKey) cp6.forceServerID(prompt('Input server id'))
});

var doc = document.createElement('div')
doc.style = `
    width: 700px;
    height: auto;
    background: rgba(0,0,0,0.5);
    z-index: 1;
    position: relative;
    border-radius: 200px;
    margin: 0 auto;
    color: white;
    text-align: center;
    font-family: 'Ubuntu';
    padding: 10px;
    text-shadow: rgb(0 0 0) 2px 0px 0px, rgb(0 0 0) 1.75517px 0.958851px 0px, rgb(0 0 0) 1.0806px 1.68294px 0px, rgb(0 0 0) 0.141474px 1.99499px 0px, rgb(0 0 0) -0.832294px 1.81859px 0px, rgb(0 0 0) -1.60229px 1.19694px 0px, rgb(0 0 0) -1.97998px 0.28224px 0px, rgb(0 0 0) -1.87291px -0.701566px 0px, rgb(0 0 0) -1.30729px -1.5136px 0px, rgb(0 0 0) -0.421592px -1.95506px 0px, rgb(0 0 0) 0.567324px -1.91785px 0px, rgb(0 0 0) 1.41734px -1.41108px 0px, rgb(0 0 0) 1.92034px -0.558831px 0px;
    pointer-events: none;
    top: -80px;
    transition: 1s ease-in-out;
}
`
document.querySelector('body').appendChild(doc)

var servers = [],
    name = "",
    id = "",
    code = ""
for (let i = 0; i <= 12; i++) {
    fetch("https://api.n.m28.io/endpoint/florrio-map-" + i + "-green/findEach/")
        .then((response) => response.json())
        .then((data) => {
        servers[i] = `MAP${i}NA${data.servers["vultr-miami"].id}EU${data.servers["vultr-frankfurt"].id}AS${data.servers["vultr-tokyo"].id}`
    })
}
function getServerId() {
    doc.style.top = '0px'
    servers.forEach(x => {code += x})
    var index = code.indexOf(url.slice(6,9))
    name = code.slice(index-2,index)
    if (name == "NA") id = code.slice(index-6,index-2)
    else if (name == "EU") id = code.slice(index-11,index-7)
    else if (name == "AS") id = code.slice(index-16,index-12)
    doc.innerHTML = `Connected to ${name} ${id}<br>${url.slice(6,-1)}`
    setTimeout(function() {
        doc.style.top = '-80px'
    }, 3000)
}

var urlA = []
setInterval(function() {
    urlA.unshift(url)
    if (urlA.length > 2) urlA.splice(2)
    if (urlA.at(-1) != urlA[0]) getServerId()
    console.log(urlA, urlA.at(-1) != urlA[0])
}, 1000)

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址