// ==UserScript== // @name GrepoSimu // @namespace greposimu // @version 1.0 // @author Mysaa Java // @homepage https://greposimu.bernard.com.de // @updateURL https://greposimu.bernard.com.de/userscript.js // @downloadURL https://greposimu.bernard.com.de/userscript.js // @description This script sends information on the town to greposimu // @include https://*.grepolis.com/game/* // @exclude view-source://* // @icon https://greposimu.bernard.com.de/favicon.ico // ==/UserScript== function downloadObjectAsJson(exportObj, exportName){ var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj,null,2)); var downloadAnchorNode = document.createElement('a'); downloadAnchorNode.setAttribute("href", dataStr); downloadAnchorNode.setAttribute("download", exportName + ".json"); document.body.appendChild(downloadAnchorNode); // required for firefox downloadAnchorNode.click(); downloadAnchorNode.remove(); } function getAllFragments() { out = {} for(var storename in ITowns){ if(typeof ITowns[storename] === 'object' && "fragments" in ITowns[storename]){ out[storename] = {} store = ITowns[storename].fragments for(var townid in store) { out[storename][townid] = [] for(var i = 0; i < store[townid].models.length;i++){ out[storename][townid].push(store[townid].models[i].attributes) } } } } return out } function makeObject() { out = {} for(var townid in ITowns.towns) { out[townid] = {} out[townid].name = ITowns.towns[townid].name out[townid].points = ITowns.towns[townid].points out[townid].god = ITowns.towns[townid].god() out[townid].unitsTotal = ITowns.towns[townid].units() out[townid].supportTotal = ITowns.towns[townid].unitsSupport() out[townid].outerTotal = ITowns.towns[townid].unitsOuter() out[townid].resources = ITowns.towns[townid].resources() out[townid].buildings = ITowns.towns[townid].getBuildings().getBuildings() out[townid].researches = ITowns.towns[townid].researches().attributes out[townid].espstorage = ITowns.towns[townid].getEspionageStorage() orderz = ITowns.towns[townid].buildingOrders() out[townid].buildingOrders = [] for(var i = 0; i