Hébergeur de fichiers indépendant

Evolzzz Alliance.user.js

À propos

Type de fichier
Fichier JS de 17 Ko (text/plain)
Confidentialité
Fichier public, envoyé le 29 septembre 2020 à 23:35, depuis l'adresse IP 82.67.x.x (France)
Sécurité
Ne contient aucun Virus ou Malware connus - Dernière vérification: hier
Statistiques
La présente page de téléchargement a été vue 7 fois depuis l'envoi du fichier
Page de téléchargement

Aperçu du fichier


// ==UserScript==
// @name     Evolzzz - Page Alliance
// @version  1.1.5
// @match      http://s4.fourmizzz.fr/alliance.php?Membres
// @grant    none
// @description Script pour Fourmizzz qui permet d'avoir les rangs de chaine Evolution
// @updateURL 29/09/2020
// @installURL https://doc-04-14-docs.googleusercontent.com/docs/securesc/qlk0ehgkvlrqheumdbna8v6cpjmeampr/6qk0aidt9gm39onpr5ihdcgv38cv9ik1/1601242200000/12762783132416555823/03936045285661714957/1GXTMc2Waa0hekfUC5k7IeLzBVOtsN21E?e=download&authuser=0&nonce=jr7hkoa5vd4ia&user=03936045285661714957&hash=kt6f4lagb135rrqsqrb3mhoj1bteckj5
// @downloadURL https://doc-04-14-docs.googleusercontent.com/docs/securesc/qlk0ehgkvlrqheumdbna8v6cpjmeampr/6qk0aidt9gm39onpr5ihdcgv38cv9ik1/1601242200000/12762783132416555823/03936045285661714957/1GXTMc2Waa0hekfUC5k7IeLzBVOtsN21E?e=download&authuser=0&nonce=jr7hkoa5vd4ia&user=03936045285661714957&hash=kt6f4lagb135rrqsqrb3mhoj1bteckj5
// @icon https://image.noelshack.com/fichiers/2020/15/6/1586615434-460140evologo.png
// ==/UserScript==
var inputAffichage = document.createElement("input");
inputAffichage.type = "button";
var cssBouton = "	box-shadow:inset 0px 1px 0px 0px #3ed355;	background:linear-gradient(to bottom, #6fc657 5%, #634b30 100%);	background-color:#7d5d3b;	border-radius:3px;" +
    "border:1px solid #54381e;	display:inline-block;	cursor:pointer;	color:#ffffff;	font-family:Arial;	font-size:12px;	padding:5px 12px;	text-decoration:none;	text-shadow:0px 1px 0px #4d3534;"
inputAffichage.setAttribute("style", cssBouton);
document.body.appendChild(inputAffichage);
var activer = "Révéler"
inputAffichage.value = activer
inputAffichage.onclick = changerBoolAffichage;
var caseStat = document.getElementsByClassName("contenu_boite_info")[0];
caseStat.appendChild(inputAffichage)
var desactiver = "Cacher"
var cssBouton2 = "box-shadow:inset 0px 1px 0px 0px #cc7167;	background:linear-gradient(to bottom, #c85b49  5%, #634b30 100%);	background-color:#7d5d3b;	border-radius:3px;" +
    "border:1px solid #54381e;	display:inline-block;	cursor:pointer;	color:#ffffff;	font-family:Arial;	font-size:12px;	padding:5px 12px;	text-decoration:none;	text-shadow:0px 1px 0px #4d3534;"

function changerBoolAffichage() {
    var version = "1.1.5"
    var rangInnactif = "RIP"

    if (inputAffichage.value === activer) {
        inputAffichage.setAttribute("style", cssBouton2);
        inputAffichage.value = desactiver
        var blocCentral = document.getElementById("alliance")
        var centreAlliance = document.getElementById("tabMembresAlliance")
        var temp = centreAlliance.innerHTML
        centreAlliance.innerHTML = temp.replace(/Rang/g, "Rang Evolution v" + version)
        // var listePseudo = [{"pseudo":"Crevette","rangChaine":"G00","rangPublic":""},{"pseudo":"Manitas","rangChaine":"G01","rangPublic":""},{"pseudo":"Misuki","rangChaine":"G02","rangPublic":""},{"pseudo":"Seneca","rangChaine":"G03","rangPublic":""},{"pseudo":"AntsBLC","rangChaine":"G04","rangPublic":""},{"pseudo":"supersteff","rangChaine":"P01","rangPublic":""},{"pseudo":"Shapius","rangChaine":"P02","rangPublic":""},{"pseudo":"draxdrax","rangChaine":"P03","rangPublic":""},{"pseudo":"Orpheus","rangChaine":"P04","rangPublic":""},{"pseudo":"rom29","rangChaine":"P05","rangPublic":""},{"pseudo":"Lordstan","rangChaine":"P06","rangPublic":""},{"pseudo":"Eniafit","rangChaine":"P07","rangPublic":""},{"pseudo":"Mikada","rangChaine":"P08","rangPublic":""},{"pseudo":"Mbarbarus","rangChaine":"P09","rangPublic":""},{"pseudo":"madzeli","rangChaine":"P10","rangPublic":""},{"pseudo":"atalante","rangChaine":"P11","rangPublic":""},{"pseudo":"guytou","rangChaine":"P12","rangPublic":""},{"pseudo":"floriang","rangChaine":"P13","rangPublic":""},{"pseudo":"TheKid","rangChaine":"P14","rangPublic":""},{"pseudo":"BystouflyDeluxe","rangChaine":"P15","rangPublic":""},{"pseudo":"Dhozkan","rangChaine":"P16","rangPublic":""},{"pseudo":"Hermione","rangChaine":"P17","rangPublic":""},{"pseudo":"Vladimir-Harkonnen","rangChaine":"P18","rangPublic":""},{"pseudo":"Rinjin","rangChaine":"P19","rangPublic":""},{"pseudo":"max56","rangChaine":"RIP","rangPublic":""},{"pseudo":"Rocheville","rangChaine":"P21","rangPublic":""},{"pseudo":"Spartian","rangChaine":"P22","rangPublic":""},{"pseudo":"Tiger3344","rangChaine":"P23","rangPublic":"tchao"},{"pseudo":"justice","rangChaine":"P24","rangPublic":""},{"pseudo":"Hawk92","rangChaine":"P25","rangPublic":""},{"pseudo":"Roiscorpion","rangChaine":"P26","rangPublic":""},{"pseudo":"Blackle","rangChaine":"RIP","rangPublic":""},{"pseudo":"SniperAnt","rangChaine":"C01","rangPublic":"Pan! t'es mort!"},{"pseudo":"tr3iz3","rangChaine":"C02","rangPublic":""},{"pseudo":"Barzoul","rangChaine":"C03","rangPublic":""},{"pseudo":"sebichou","rangChaine":"C04","rangPublic":""},{"pseudo":"akrapovic","rangChaine":"C05","rangPublic":""},{"pseudo":"shaw892","rangChaine":"C06","rangPublic":""},{"pseudo":"Pako","rangChaine":"C07","rangPublic":""},{"pseudo":"thebest","rangChaine":"C08","rangPublic":""},{"pseudo":"Forcide","rangChaine":"C09","rangPublic":""},{"pseudo":"zizeb","rangChaine":"RIP","rangPublic":""},{"pseudo":"sgt-ripley","rangChaine":"RIP","rangPublic":""},{"pseudo":"NemesiaQc","rangChaine":"RIP","rangPublic":""},{"pseudo":"jaspe","rangChaine":"RIP","rangPublic":""},{"pseudo":"ManifQc","rangChaine":"RIP","rangPublic":""},{"pseudo":"Lune","rangChaine":"RIP","rangPublic":""},{"pseudo":"noir","rangChaine":"RIP","rangPublic":""},{"pseudo":"Shumii","rangChaine":"RIP","rangPublic":""}]
        var monPseudo = getMoi()
        var monRang = getMonRang(monPseudo)
        getMoi(monRang)
        // console.log("Avant : " + monPseudo + " = " + monRang)

        for (var pseudo in listePseudo) {
            changerRangParPseudo(listePseudo[pseudo].pseudo, listePseudo[pseudo].rangChaine, monPseudo, monRang, 4)
            listePseudo[pseudo].position = getIndex(listePseudo[pseudo].pseudo)

            if (listePseudo[pseudo].position === undefined) {
                listePseudo[pseudo].position = getMaPosition(monPseudo)
            }
        }

        monRang = getMonRang(monPseudo)
        // console.log("Après : " + monPseudo + " = " + monRang)

    } else if (inputAffichage.value !== activer) {
        // On recharge entièrement la page
        location.reload()
    }

    var doitFlooder

    for (var pseudo2 in listePseudo) {
        doitFlooder = comparerRangs(listePseudo[pseudo2].pseudo, monRang, monPseudo)
        changerRangParPseudo(listePseudo[pseudo2].pseudo, listePseudo[pseudo2].rangChaine, monPseudo, monRang, doitFlooder)

        var estAuDessus = determinerSiPositionSup(listePseudo, monPseudo, listePseudo[pseudo2].pseudo)
        // console.log("Je suis au dessus de " + listePseudo[pseudo].pseudo + "(" + listePseudo[pseudo].position + ") : " + listePseudo[pseudo].estAuDessus)
        if (doitFlooder === 1) {
            pseudoRouge(listePseudo[pseudo2].pseudo)
        } else if (doitFlooder === 2) {
            pseudoVert(listePseudo[pseudo2].pseudo)
        } else if (doitFlooder === 3) {
            pseudoBleu(listePseudo[pseudo2].pseudo)
        } else if (doitFlooder === 0) {
            rangBlanc(monRang)
        }
    }

    // listePseudo = changerSiAuDessus(listePseudo, monPseudo, monRang)
    console.log(listePseudo)
    // changerSiProtect(listePseudo)
    detectInnactif(rangInnactif, "")
}


function changerSiProtect(listePseudo) {
    for (var pseudo in listePseudo) {

        if (new RegExp(listePseudo[pseudo])) {
            var regex = new RegExp(listePseudo[pseudo])
            for (const a of document.querySelectorAll("a")) {
                if (a.textContent.match(regex)) {
                    if (listePseudo[pseudo].protect === true) {
                        //console.log(a.textContent + " protect : " + listePseudo[pseudo].protect)

                        //var parent = a.parentNode
                        //var tr = parent.querySelectorAll('tr:not(.top-row) > td')[2]
                        //console.log(tr.innerHTML)
                        //rang.innerHTML = '🛡️' + rang.innerHTML + '🛡️'

                    }
                }
            }
        }
    }
}

function changerSiAuDessus(listePseudo, monPseudo, monRang) {
    var maPosition

    console.log("111")
    for (var pseudo in listePseudo) {
        var doitFlooder = comparerRangs(listePseudo[pseudo].pseudo, monRang, monPseudo)
        console.log("doitFlooder = " + doitFlooder)

        if (doitFlooder === 2) {
            console.log("3333")
            listePseudo[pseudo].protect = false

            if (listePseudo[pseudo].pseudo === monPseudo) {
                console.log("4444")
                maPosition = listePseudo[pseudo].position
            }

            listePseudo[pseudo].estAuDessus = true
            listePseudo[pseudo].protect = true
            // console.log(listePseudo[pseudo].pseudo + " - " + listePseudo[pseudo].estAuDessus)
        }
    }

    return listePseudo
}

function determinerSiPositionSup(listePseudo, pseudo1, pseudo2) {
    var position1
    var position2

    for (var pseudo in listePseudo) {
        if (listePseudo[pseudo].pseudo === pseudo1) {
            position1 = parseInt(listePseudo[pseudo].position)
        }

        if (listePseudo[pseudo].pseudo === pseudo2) {
            position2 = parseInt(listePseudo[pseudo].position)
        }

        if (position1 < position2) {
            listePseudo[pseudo].estAuDessus = true
        } else if (position1 >= position2 || !position1 || !position2) {
            listePseudo[pseudo].estAuDessus = false
        }
    }

    return listePseudo
}

function getIndex(pseudo) {
    var rang

    for (const a of document.querySelectorAll("td")) {
        if (a.textContent === pseudo) {
            var parent = a.parentNode
            var tr
            tr = parent.querySelectorAll('tr:not(.top-row) > td')[1]

            if (!tr) {
                tr = parent.querySelectorAll('tr:not(.top-row) > td')[0]
            }
            rang = tr.textContent
        }
    }

    return rang
}

function detectInnactif(rangInnactif, newAffichage) {
    for (const a of document.querySelectorAll("td")) {
        if (a.textContent === rangInnactif) {
            a.innerHTML = newAffichage
        }
    }
}

function rangBlanc(rang) {
    for (const a of document.querySelectorAll("a")) {
        if (a.textContent.match(new RegExp("^" + rang))) {
            if (a.innerHTML === rang) {
                a.setAttribute("style", "text-shadow:8px 8px 5px  #b152527d; color:white")
            }
        }
    }
}

function pseudoRouge(pseudo) {
    for (const a of document.querySelectorAll("a")) {
        if (a.textContent.match(new RegExp("^" + pseudo))) {
            if (a.innerHTML === pseudo) {
                // a.innerHTML = pseudo + " - à flooder"
                a.setAttribute("style", "text-shadow:8px 8px 5px  #b152527d; color:#ef3838")
                a.innerHTML = '<img src="http://s4.fourmizzz.fr/images/attention.gif" width="15px" title="A FLOODER">&nbsp;' + a.innerHTML + '&nbsp;<img src="http://s4.fourmizzz.fr/images/attention.gif" width="15px" title="A FLOODER">'
            }
        }
    }
}

function pseudoVert(pseudo) {
    for (const a of document.querySelectorAll("a")) {
        if (a.textContent.match(new RegExp("^" + pseudo))) {
            if (a.innerHTML === pseudo) {
                // a.innerHTML = pseudo + " - ne pas flooder"
                a.setAttribute("style", "text-shadow:8px 8px 5px  #a6ae4a; color:#30af30b8")
                a.innerHTML = '🛡️&nbsp;' + a.innerHTML + '&nbsp;🛡️'
            }
        }
    }
}

function pseudoBleu(pseudo) {
    for (const a of document.querySelectorAll("a")) {
        if (a.textContent.match(new RegExp("^" + pseudo))) {
            if (a.innerHTML === pseudo) {
                // a.innerHTML = pseudo + " - ne pas flooder"
                a.setAttribute("style", "text-shadow:8px 8px 5px  #111c2463; color:#0c2b5c96;")
            }
        }
    }
}


function changerRangParPseudo(pseudo, newRang, monPseudo, monRang, doitFlooder) {
    for (const a of document.querySelectorAll("a")) {

        if (a.textContent.match(new RegExp("^" + pseudo))) {
            if (a.innerHTML === monPseudo) {
                // Changer le pseudo
                a.innerHTML = monPseudo + " 😃"
                a.setAttribute("style", "text-shadow:6px 6px 14px  #000000; color:white")
            }

            var node = a.parentNode
            var grandParent = node.parentNode
            // Admin
            var rang = grandParent.querySelectorAll('tr:not(.top-row) > td')[2]
            // Non-Admin
            if (!rang) {
                rang = grandParent.querySelectorAll('tr:not(.top-row) > td')[1]
            }

            // Changer le rang
            rang.textContent = newRang

            if (doitFlooder === 0) {
                rang.setAttribute("style", "text-shadow:5px 5px 20px  #000000; color:white")
                rang.innerHTML = '👉&nbsp;' + rang.innerHTML + '&nbsp;👈'
            } else if (doitFlooder === 1) {
                // 1 = A FLOODER
                rang.setAttribute("style", "text-shadow:8px 8px 6px  #000000; color:#af4343")
            } else if (doitFlooder === 2) {
                // 2 = NE PAS FLOODER
                rang.setAttribute("style", "text-shadow:8px 8px 15px #000000; color:green")
            } else if (doitFlooder === 3) {
                // 3 = AUTRE RANG
                rang.setAttribute("style", "text-shadow:8px 8px 8px  #000000; color:blue")
            }
        }
    }
}

function comparerRangs(sonPseudo, monRang, monPseudo) {
    var flooder

    for (const z of document.querySelectorAll("a")) {
        if (z.textContent.match(new RegExp("^" + sonPseudo))) {
            var node = z.parentNode
            var grandParent = node.parentNode
            // Admin
            var rang = grandParent.querySelectorAll('tr:not(.top-row) > td')[2]
            // Non-Admin
            if (!rang) {
                rang = grandParent.querySelectorAll('tr:not(.top-row) > td')[1]
            }

            var sonRang = rang.textContent
            var monType = monRang.substring(0, 1)
            var monTypeLong = getTypeLong(monType)
            var monRangNum = monRang.substring(1, 3)
            var sonType = sonRang.substring(0, 1)
            var sonTypeLong = getTypeLong(sonType)
            var sonRangNum = sonRang.substring(1, 3)

            if (monPseudo === sonPseudo) {
                flooder = 0
            }

            if (sonRangNum > monRangNum && monType === sonType) {
                flooder = 1
            }

            if (sonRangNum < monRangNum && monType === sonType) {
                flooder = 2
            }

            if (monType !== sonType) {
                flooder = 3
            }
            // console.log(monPseudo + " " + sonPseudo + " monRangNum =" + monRangNum + ", sonRangNum = " + sonRangNum + ", son type = " + sonType + ", mon type = " + monType + " : flooder = " + flooder)
        }
    }

    return flooder

}

function getTypeLong(typeCourt) {
    var typeLong

    if (typeCourt === "G") {
        typeLong = "Grenier"
    } else if (typeCourt === "P") {
        typeLong = "Passeur"
    } else if (typeCourt === "C") {
        typeLong = "Chasseur"
    } else {
        typeLong = typeCourt
    }

    return typeLong
}

function getMonRang(monPseudo) {
    var monRang

    for (const c of document.querySelectorAll("a")) {
        var regex3 = new RegExp("^" + monPseudo)

        if (c.textContent.match(regex3)) {
            var temp = c.parentNode.parentNode
            monRang = temp.querySelectorAll('tr:not(.top-row) > td')[2].textContent

            if (!monRang) {
                monRang = monRang.querySelectorAll('tr:not(.top-row) > td')[1].textContent
            }
        }
    }

    return monRang
}

function getMaPosition(monPseudo) {
    var maPosition

    for (const c of document.querySelectorAll("a")) {
        var regex3 = new RegExp("^" + monPseudo)

        if (c.textContent.match(regex3)) {
            var temp = c.parentNode.parentNode
            maPosition = temp.querySelectorAll('tr:not(.top-row) > td')[1].textContent

            if (!maPosition) {
                maPosition = maPosition.querySelectorAll('tr:not(.top-row) > td')[0].textContent
            }
        }
    }

    return maPosition
}

function getMoi(monRang) {
    var monPseudo = ""

    for (const b of document.querySelectorAll("a")) {
        var regex2 = new RegExp("^S4")

        if (b.textContent.match(regex2)) {
            monPseudo = b.textContent.replace(/S4 /, "")

            if (monRang && monRang !== "") {
                b.parentNode.textContent = monRang
            }
        }
    }

    return monPseudo
}


Partager le fichier


Télécharger Evolzzz_Alliance.user.js


Télécharger Evolzzz_Alliance.user.js