'Delta - 999999 in 1

Delta - extension for agario, agar.io mod collection

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         'Delta - 999999 in 1
// @name:ru      'Delta - 999999 в 1
// @description       Delta - extension for agario, agar.io mod collection
// @description:ru       Delta - расширение для агарио, сборник модов для agar.io
// @version      5.99
// @namespace    delta.agar
// @author       neo
// @icon         https://deltav4.gitlab.io/ext/assets/favicon.ico
// @match        *://agar.io/*
// @run-at       document-start
// @connect      ogario.ovh
// @connect      glitch.me
// @connect      ex-script.com
// @connect      gitlab.io
// @connect      127.0.0.1
// @connect      sigr.io
// @grant        GM.xmlHttpRequest
// @grant        GM.registerMenuCommand
// @grant        window.close
// ==/UserScript==

/*
  GREASYFORK VERSION
  Copying and subsequent publication of this source code is prohibited. The publication of this user script is allowed, use the following links:
    - https://greasyfork.org/ru/scripts/399197-delta-999999-in-1
    - https://deltav4.gitlab.io/deltav4.user.js
  If this user script does not start, write me a discord
  Если данное расширение не запускается, напишите мне в дискорд
  https://discord.gg/HHmyKW6
*/



try{
    GM.registerMenuCommand('\uD83D\uDF02\u2075 Delta 5', function() {
        window.location.href="https://agar.io/v5"
    });
    GM.registerMenuCommand('\uD83D\uDF02\u2074 Delta 4', function() {
        window.location.href="https://agar.io/v4"
    });
    GM.registerMenuCommand('\u2104 Legendmod (n/a)', function() {
        alert('Sorry, this mod is not available in this user-script')
    });
    GM.registerMenuCommand('\u24B6 Agar Tool (Backup copy)', function() {
        window.location.href="https://agar.io/ato"
    });
    GM.registerMenuCommand('\u24B6 Agar Tool (n/a)', function() {
        alert('Sorry, this mod is not available in this user-script')
    });
    GM.registerMenuCommand('\u2164 VANILLA (n/a)', function() {
        alert('Sorry, this mod is not available in this user-script')
    });
    GM.registerMenuCommand('\u1EFA HSLO', function() {
        window.location.href="https://agar.io/hslo"
    });
    GM.registerMenuCommand('\u2168 Agarix', function() {
        window.location.href="https://agar.io/ix"
    });
    GM.registerMenuCommand('\u00D8 Ogario', function() {
        window.location.href="https://agar.io/ogario"
    });
    GM.registerMenuCommand('\uD83D\uDDAD Delta Discord', function() {
        window.location.href="https://discord.gg/HHmyKW6"
    });
}catch(e){}

if(window.document && window.document.title === 'Attention Required! | Cloudflare'){
    return
}

if (window.location.host == 'agar.io' && window.location.pathname === '/' ) {
    window.stop()
    window.location.href = 'https://agar.io/delta';
    return;
}

if (window.location.pathname.indexOf('delta')>-1) {
    window.history && window.history.replaceState && window.history.replaceState({}, window.document.title, '/');
}



var webBase = 'https://deltav4.gitlab.io'
var devBase = 'http://127.0.0.1:5636/deltav4.gitlab.io/'
var defaultMode = 'v5'
var location = ''
var isDevMode = window.location.pathname.indexOf('dev') > -1
var modes = {
    "url":function(){
        // For developers
        // example http://agar.io/url?https://your.host.com/
        // add
        // @connect      your.host.com
        location = window.location.search.slice(1)
    },
    "ogario":function(){
        location = 'https://cdn.ogario.ovh/v4/beta/'
    },
    "v4":function(){
        location = (isDevMode?devBase:webBase)+'/v4/index.html'
    },
    "v5":function(){
        location = (isDevMode?devBase:webBase)+'/ext/index.html'
    },
    "ix":function(){
        location = 'https://sentinelix-source-agarix.glitch.me/'
    },
    "ato":function(){
        location = (isDevMode?devBase:webBase)+'/agartool/index.html'
    },
    "hslo540":function(){
        location = (isDevMode?devBase:webBase)+'/hslo540/index.html'
    },
    "hslo536":function(){
        location = (isDevMode?devBase:webBase)+'/hslo536/index.html'
    },
    "hslo532":function(){
        location = (isDevMode?devBase:webBase)+'/hslo532/index.html'
    },
    "hslo":function(){
        location = 'https://hslo.sigr.io/'
    }
}

for(var mode in modes){
    var isMatched = window.location.pathname.indexOf(mode) > -1
    if(isMatched) {
        modes[mode]()
        break;
    }
}
if(!isMatched) modes[defaultMode]()


document&&document.documentElement&&(document.documentElement.innerHTML = 'Extension is loading');

if(location==='none'){

}else{
    console.log('Extension location',location)
    loader()
}
function loader(){
        GM.xmlHttpRequest({
        method: "GET",
        url: location+'?'+Math.random(),
        onload: async function(e) {
            var blob = new Blob(['\ufeff'+e.responseText], {type:"text/html;charset=windows-1252"});
            var reader = new FileReader();
            reader.onload = function() {
                document.open();
                var str = reader.result
                if(isDevMode) str = str.replace(webBase,devBase)
                if(mode==='hslo') str = str.replace('<head>','<head><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>')
                document.write(str);
                document.close();
            }
            reader.readAsText(blob);

        }
    })
}