V-removeTradeRoutes

remove all trade routes in 2 clics

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         V-supprimerRoutes
// @name:en      V-removeTradeRoutes
// @namespace    http://tampermonkey.net/
// @version      0.5
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @author       azro
// @include     *://*.travian.*/*
// @include     *://*.travian.*/*
// @include     *://*.travian.*.*/*
// @include     *://travian.*/index.php*
// @exclude     *://*.travian*.*/support.php*
// @exclude     *://help.travian*.*
// @grant  GM_addStyle
// @description supprimer toutes les routes d'un village en 2 clics
// @description:en remove all trade routes in 2 clics
// ==/UserScript==

(function() {
    'use strict';
    let $$ = jQuery.noConflict();
    if ($$("#build").hasClass( "gid17" )) {
        boutonSupprimerRoutes();
    }
})();
//------------------------------------------------------------------------------
function boutonSupprimerRoutes(){
    let $$ = jQuery.noConflict();
    $$(".a.arrow").first().parent().css("width","50%");
    let element = '<div id="boutonSupprDiv"><button id="supprimerRoutes" class="green prepare"><div class="button-container addHoverClick"><div class="button-background"><div class="buttonStart">'+
        '<div class="buttonEnd"><div class="buttonMiddle"></div></div></div></div><div class="button-content">Supprimer TOUTES les routes</div></div></button></div>';
    $$(".a.arrow").first().parent().after(element);
    $$("#boutonSupprDiv").css("text-align","right");
    $$("#supprimerRoutes").css("margin-bottom","5px");
    $$("#supprimerRoutes").click(function(){
        supprimerRoutes();
    });
}

function supprimerRoutes() {
    let $$ = jQuery.noConflict();

    if(confirm("Êtes-vous sûr de vouloir supprimer TOUTES les routes de ce village ?\n'OK' pour continuer sinon 'Annuler'")==true){
        $$('.sel').each(function(){
            let lien = $$(this).find("a").attr("href");
            $$.get(lien);
        });
    }
}