// ==UserScript== // @name The West Chat Auto Opener // @author Mr. Perseus // @namespace tw-perseus // @description Automatically opens the alliance chat on startup. // @include https://*.the-west.*/game.php* // @include http://*.the-west.*/game.php* // @include https://*.tw.innogames.*/game.php* // @include http://*.tw.innogames.*/game.php* // @version 0.0.1 // @grant none // @downloadURL none // ==/UserScript== "use strict";(function(a){var b=document.createElement("script");b.setAttribute("type","application/javascript"),b.textContent="("+a+")();",document.body.appendChild(b),document.body.removeChild(b)})(function(){var a={version:"0.0.1"};a.InitUpdater=function(){setTimeout(function(){$.getScript("https://glcdn.githack.com/knom_retsam/the-west-public/raw/master/script-updater.js",function(){if(scriptUpdater.TWCAO>a.version)var b=new west.gui.Dialog("Update: The West Chat Auto Opener","Update Available

v"+scriptUpdater.TWCAO+":
"+scriptUpdater.TWCAONew+"
",west.gui.Dialog.SYS_WARNING).addButton("Update",function(){b.hide(),location.href="https://greasyfork.org/scripts/40902-the-west-duel-warner/code/The%20West%20Duel%20Warner.user.js"}).addButton("cancel").show()})},5e3)},a.OpenChat=function(){var a=0,b=function b(){a++;$("div[id^=\"room_alliance_\"] .row_title").length&&$("div[id^=\"room_alliance_\"] .row_title").trigger("click"),20>a&&!$("div[class^=\"chat_room room_alliance_\"]").length&&setTimeout(b,1e3)};b()},$(document).ready(function(){try{a.InitUpdater(),a.OpenChat()}catch(a){console.log(a.stack)}})});