// ==UserScript== // @name TWLeoTools // @namespace TomRobert // @author Leotas (updated by Tom Robert) // @description Useful tools for The West! // @include https://*.the-west.*/game.php* // @include https://*.the-west.*/index.php?page=logout // @include https://www.the-west.* // @include https://beta.the-west.net* // @version 1.29.1 // @grant none // @downloadURL none // ==/UserScript== // translation: Tom Robert(German & English), Darius II/Wojcieszy(Polish), pepe100(Spanish), ruud99(Dutch), Creature(Hungarian) (function (fn) { var script = document.createElement('script'); script.setAttribute('type', 'application/javascript'); script.textContent = '(' + fn.toString() + ')();'; document.body.appendChild(script); document.body.removeChild(script); }) (function () { if (location.href.indexOf('index.php?page=logout') != - 1) { location.href = '/'; } if (location.href.indexOf('https://www.the-west.') != - 1 || location.href.indexOf('https://beta.the-west.net') != - 1) { window.onload = function () { var lang = { net: 'Load all your active worlds with one click', de: 'Lade all deine aktiven Welten mit einem Klick', pl: 'Załaduj wszystkie aktywne światów za pomocą jednego kliknięcia', es: 'Cargar todos los mundos activos con un solo clic', nl: 'Laad al uw actieve werelden met één klik', hu: 'Betölti az összes aktív világok egyetlen kattintással', }; Worlds.show = (function () { var newstuff = Worlds.show; return function () { newstuff.apply(this, arguments); var count = 0; $('#selectWorldText').append(''); $('#loginAll').css({ 'left': '-3px', 'top': '36px', 'position': 'relative', 'cursor': 'pointer', }).click(function () { var t = Worlds.playerWorlds; for (var x in t) { if (t[x][1] !== null) { if (count === 0) Auth.login(t[x]); else window.open(location + '#loginWorld' + x, '_blank'); count += 1; } } }); }; }) (); }; if (location.hash.indexOf('loginWorld') != - 1) { setTimeout(function () { $('#loginButton').click(); var val = setInterval(function () { var u = Worlds.playerWorlds; if (Object.keys(u).length !== 0) { clearInterval(val); Auth.login(u[parseFloat(location.hash.replace(/\D/g, ''))]); } }, 500); }, 1000); } } if (location.href.indexOf('game.php') != - 1) { TWLTstart = { version: '1.29.1', name: 'TWLeoTools', author: 'Leotas (updated by Tom Robert)', minGame: '2.04', maxGame: Game.version.toString(), website: 'https://greasyfork.org/scripts/7238', updateUrl: 'https://raw.githack.com/TomRobert/tw/master/sU.js', updateAd: 'http://adf.ly/1OMM8P', }; langs = { en_US: { language: 'None (English)', ApiGui1: 'This script contains many features to simplify your everyday life in The West: