// ==UserScript== // @name Ikariam - Check island slots // @namespace http://tampermonkey.net/ // @version 0.2 // @description try to take over the world! // @author You // @match *://*.ikariam.gameforge.com/* // @grant none // @downloadURL none // ==/UserScript== // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js /*--- Cross-browser Shim code follows: */ function shim_GM_notification () { if (typeof GM_notification === "function") { return; } window.GM_notification = function (ntcOptions) { checkPermission (); function checkPermission () { if (Notification.permission === "granted") { fireNotice (); } else if (Notification.permission === "denied") { alert ("User has denied notifications for this page/site!"); return; } else { Notification.requestPermission ( function (permission) { console.log ("New permission: ", permission); checkPermission (); } ); } } function fireNotice () { if ( ! ntcOptions.title) { console.log ("Title is required for notification"); return; } if (ntcOptions.text && ! ntcOptions.body) { ntcOptions.body = ntcOptions.text; } var ntfctn = new Notification (ntcOptions.title, ntcOptions); if (ntcOptions.onclick) { ntfctn.onclick = ntcOptions.onclick; } if (ntcOptions.timeout) { setTimeout ( function() { ntfctn.close (); }, ntcOptions.timeout); } } } } (function() { 'use strict'; shim_GM_notification(); var queryString = window.location.search; var urlParams = new URLSearchParams(queryString); var page = urlParams.get('view'); if(page != 'worldmap_iso') //Execute only if in World view return; var city_name = 'Riloos [49:52]'; var max_slots = "17"; var timeout1 = setTimeout( function () { if($(".islandTile[title='" + city_name + "']").find(".cities").html() != max_slots){ alert("Slot available!"); } clearTimeout(timeout1); }, 2000); var timeout2 = setTimeout( function () { clearTimeout(timeout2); location.reload(); },60000 ); })();