// ==UserScript==
// @name MyFreeFarm Rackoverview
// @namespace https://github.com/BastianKanaan/GMscripts_MyFreeFarm
// @author BastianKanaan
// @description Gives an overview of your products
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BGgo6NO+u5q4AAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAS0ElEQVRo3t2aeYxl11ngf+fub3+172t3V1cv7sVuJ3bs7jh2QtoMDoHEwRlCbMJEATRiSaKBQTNBCKGwBwSDNAyTQVGCYJIMEINjxrFix3E73mO7TW/V1VXVtS+v6i13v+ee+aNvQSXDaCTS7W7nSE/v3veuzrm/8y3nO9934Dq08cE+APv9E/1//tDN+16/9+hNJ/l+bXv3jAHw4zf1P/sLdx5TRqXyc++fHPvsGzW+/kbC5vMOyyvrfOSDJz99eM/gj+09fkK9Na/fW8sVzr86NfOl7ydgB+iK46TnVz75wJNtHZX3rcuUI8dvFS9cnuHQ7YcOWprTfvb8pUe/H4BzwH7g0H/59INfq3Z09++ZHBPHbn8LpVKF3WNdWPlOdeIdd962MDf/8vSl+XPX8mW0awxrAiPAgd/4xXf+wdaG74yP7BL9w/vp7x2h1WrRM3SYwf5+8cLz31Yf/w8f/fK1nn3tGkt2D3AE6J7o6xoc7Cjyq//pt3ntm88wMzvDhfMX+dmP/AJJnDKxe0j09HQZDzzwns+9GVW6CBwGjgIdhbz91vfdffjg6soWrhcwf+p5Cu7L3DwhWTkdYvVWCeOEQsFm//5dY1/4wld+880kYQeYBG4CqoD23uMTk0mcQJTQF9R4/48PM3mwDU2HDz5Y5dk/+VPc5YuErZpKooZ9LSVsXOX+BNAB7AUK2X1yx97C7oXpNQb7Nrn5pw5hOA6FthLFYh4hdD7+B8NceHGKi2eqYmTfmAGwb3I3Z85O3fAS1oHubckC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sw1NbCIFj64gWTFaUfA37kken6oyA/HHUMfwqWuV6tANwJ/BrwF9le+W7gs6OVwnYq4k9vGuy8cP/+8jPQb/4L6/0w8BPAFxHi+I7//puZyx/YMc5f2MXKEa5z07Ii2k8AN2c7KwG8e8czd+Rs+wN2tTM33Nv9L/XRA9wP3PVdGpf7rue6rsYL/x8HbwtumjbAVwAAAABJRU5ErkJggg==
// @date 20.07.2015
// @version 1.4.0
// @include /^http:\/\/(|www\.|s\d+\.)au\.myfreefarm\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)veselaferma\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.br\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.de\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.cz\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.dk\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.gr\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)migranjalinda\.es\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)mabelleferme\.fr\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.hr\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.ae\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.ir\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.it\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)enkicsitanyam\.hu\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.nl\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.co\.nz\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.no\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)wolnifarmerzy\.pl\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)pt\.myfreefarm\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)fermavesela\.ro\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)mojaderewnja\.ru\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.se\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)th\.myfreefarm\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)tr\.myfreefarm\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.co\.uk\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\/.*$/
// @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.vn\/.*$/
// @exclude http://*/dyn_bubbles.php*
// @exclude http://*/login_inc.php*
// @exclude http://*/stadt/*
// @exclude http://*/nachrichten/*
// @exclude http://*/vertraege/*
// @exclude http://*/nutzer/*
// @exclude http://*/payment/*
// @grant GM_addStyle
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_listValues
// @grant GM_log
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @require https://raw.githubusercontent.com/BastianKanaan/GMscripts_MyFreeFarm/master/MyFreeFarm_Common_functions.user.js
// ==/UserScript==
// GM_log("Run Code Rackoverview:"+location.href);
const VERSION=GM_info["script"]["version"];
const neededVersionBerater="2.5.3";
const neededVersionFunctionFile="2.1.7";
//const USO_ID ="85587";
//const USO_Home =GM_info["script"]["namespace"]
//const USO_Source="http://userscripts.org/scripts/source/"+USO_ID+".user.js";
//const USO_Meta ="http://userscripts.org/scripts/source/"+USO_ID+".meta.js";
const GM_Home =GM_info["script"]["namespace"];
const GM_Source=GM_info["script"]["namespace"];
if(!VERSIONfunctionFile){
alert("Hi, I am the MyFreeFarm Rackoverview-Script.\nThe function-file is missing.\nPlease install me again.");
location.href=GM_Source;
}else if(compareVersions(neededVersionFunctionFile,VERSIONfunctionFile)>0){
alert("Hi, I am the MyFreeFarm Rackoverview-Script.\nThe function-file is too old.\nPlease install me again.");
location.href=GM_Source;
}
var DEVMODE=GM_getValue("devmode",false);
var DEVMODE_EVENTS=GM_getValue("devmode_events",false);
var DEVMODE_FUNCTION=GM_getValue("devmode_function",false);
//08.03
//var gameLocation=[null,null];
const sign_basepoint = "\u2031";
const EMPTYFILE = ["FARMNAME",0,[],0,1,1,0,[]];
var FARMNAME = null;
var FARMNR = null;
var bestand = new Array();
// bestand[int] = [farmName(string),money(int),rack(array of int),points(int),level(int),quest(int),quest-calc-to(int),missing amounts for quests(array of int)]
var prodTotal = new Array;
var productStatTime = 0;
var todayTime = new Date();
todayTime = Math.round(new Date(todayTime.getFullYear(),todayTime.getMonth(),todayTime.getDate(),0,0,0,0).getTime()/1000);
/*
function showMarket(pid){
var cell = $top("shop");
if(cell){
if (top.window.wrappedJSObject.city!=1){
top.document.addEventListener("gameCity1",function(){
top.document.removeEventListener("gameCity1",arguments.callee,false);
showMarket(pid);
},false);
click($top("citylineitem1"));
} else if (cell.style.display!="block"){
cell.style.display = "block";
cell.style.visibility = "visible";
cell = $top("transp3");
cell.style.display = "block";
cell.style.visibility = "visible";
showMarket(pid);
} else {
$top("shopframe").src = "http://s"+SERVER+"."+GAMEPAGES[LNG]+"/stadt/markt.php"+(typeof pid!="undefined"?"?page=1&order=p&id="+pid+"&filter=1&guild=0":"");;
}
//closeInfoPanel();
} else {
location.href = "http://s"+SERVER+"."+GAMEPAGES[LNG]+"/stadt/markt.php"+(typeof pid!="undefined"?"?page=1&order=p&id="+pid+"&filter=1&guild=0":"");;
}
}*/
function showMarket(pid){
try{
if((gameLocation[0]!="city")||(gameLocation[1]!=1)){
document.addEventListener("gameCity1",function(pid){ return function(){
document.removeEventListener("gameCity1",arguments.callee,false);
showMarket(pid);
};}(pid),false);
click($("speedlink_city1"));
}else if($("market").style.display!="block"){
document.addEventListener("gameOpenMarket",function(pid){ return function(){
document.removeEventListener("gameOpenMarket",arguments.callee,false);
showMarket(pid);
};}(pid),false);
unsafeWindow.close_page();
unsafeWindow.hideDiv("shop");
unsafeWindow.hideDiv("wbwcontainer");
unsafeWindow.hideDiv("adcolumn");
$("transp3").style.visibility = "visible";
unsafeWindow.showDiv("transp3");
unsafeWindow.marketAction("marketinit");
}else{
closeInfoPanel();
unsafeWindow.market_filter_name="";
unsafeWindow.market_filter_pid=parseInt(pid,10);
unsafeWindow.market_filter_own=0;
unsafeWindow.market_guild_filter=0;
unsafeWindow.showOffers();
}
}catch(err){ GM_logError("showMarket pid="+pid+"\n"+err); }
}
/*
function readProductStat(){
GM_log("readProductStat "+LNG+"."+SERVER);
GM_xmlhttpRequest({
method: "POST",
url: "http://s"+SERVER+"."+GAMEPAGES[LNG]+"/stadt/stats.php?type=18&PAGE=1",
headers:{
'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0C)'
},
onerror: function(){
alert("error");
},
onload: function(response) {
if (response.responseText) {
try{
//GM_log(response.responseText.match(/
<\/div>((.|\n)*)
<\/div>((.|\n)*)
/g,"");
if (newdiv.firstElementChild.id == "rankingcontent"){
for (var v=0;v
'+mouseOverText+'
';
toolTip.show(event,mouseOverText);
}
},false);
//Filter Pflanzen
var newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_v"],"class":"rackcat1v","style":"float:left;width:27px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll 0px 0px transparent;"},newdiv);
if (mode2.match(/v/)) {
newdiv1.style.backgroundPosition=" 0px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition=" 0px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition=" 0px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/v/)){ mode2=mode2.replace(/v/,""); }
else { mode2 += "v"; }
} else { mode2 = "v"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
//Filter fortschrittliche Produkte
newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_e"],"class":"link","style":"float:left;width:27px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll -27px 0px transparent;"},newdiv);
if (mode2.match(/e/)) {
newdiv1.style.backgroundPosition="-27px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition="-30px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition="-30px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/e/)){ mode2=mode2.replace(/e/,""); }
else { mode2 += "e"; }
} else { mode2 = "e"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
//Filter Öl
newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_o"],"class":"link","style":"float:left;width:54px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll -53px 0px transparent;"},newdiv);
if (mode2.match(/o/)) {
newdiv1.style.backgroundPosition="-53px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition="-53px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition="-53px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/o/)){ mode2=mode2.replace(/o/,""); }
else { mode2 += "o"; }
} else { mode2 = "o"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
//Filter Baumarkt
newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_z"],"class":"link","style":"float:left;width:54px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll -159px 0px transparent;"},newdiv);
if (mode2.match(/z/)) {
newdiv1.style.backgroundPosition="-159px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition="-159px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition="-159px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/z/)){ mode2=mode2.replace(/z/,""); }
else { mode2 += "z"; }
} else { mode2 = "z"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
//Filter Picknick
newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_fw"],"class":"link","style":"float:left;width:54px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll -106px 0px transparent;"},newdiv);
if (mode2.match(/fw1fw2fw3fw4/)) {
newdiv1.style.backgroundPosition="-106px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition="-106px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition="-106px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/fw1fw2fw3fw4/)){ mode2=mode2.replace(/fw1fw2fw3fw4/,""); }
else { mode2 += "fw1fw2fw3fw4"; }
} else { mode2 = "fw1fw2fw3fw4"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
//Filter Blumen
newdiv1 = createElement("div",{"mouseOverText":text[LNG]["category_fl"]+" "+text[LNG]["category_fla"],"class":"link","style":"float:left;width:54px;height:39px;background:url('"+GFX+"rack_sort_top.png') repeat scroll -212px 0px transparent;"},newdiv);
if (mode2.match(/flfla/)) {
newdiv1.style.backgroundPosition="-212px -78px";
} else {
newdiv1.addEventListener("mouseout",function(){this.style.backgroundPosition="-212px 0px";},false);
newdiv1.addEventListener("mouseover",function(){this.style.backgroundPosition="-212px -39px";},false);
}
newdiv1.addEventListener("click",function(event){
if(event.ctrlKey){
if(mode2.match(/flfla/)){ mode2=mode2.replace(/flfla/,""); }
else { mode2 += "flfla"; }
} else { mode2 = "flfla"; }
$("infoPanel").setAttribute("mode","");
buildInfoPanel("rackoverview",mode2);
},false);
var newtable = createElement("table",{"border":"1", "height": "500px", "style":"position:absolute;top:50px;left:0px;-moz-user-select:none;"},div);
newtable.addEventListener("mouseover",function(event){
var node = event.target;
while((node!=this)&&(!node.getAttribute("mouseOverText"))){ node = node.parentNode; }
if(node!=this){ showToolTip(event,node.getAttribute("mouseOverText"),this); }
},false);
var newtr = createElement("tr",{},newtable);
var newtd = createElement("td",{},newtr);
for(var farm=0;farm1){
createElement("td",{"style":"text-align:center;"},newtr,"\u03A3");
}
//benötige ich nicht
//createElement("td",{"style":"text-align:center;",title:getDateStr(productStatTime/1000)},newtr,"Stat Total");
//createElement("td",{"style":"text-align:center;"},newtr,"Total");
var oldclass = "c";
mode2 += oldclass;
newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr,unsafeWindow.t_money);
var sum = 0;
for(var farm=0;farm1){
createElement("td",{"style":"text-align:right;"},newtr,numberFormat(sum));
}
newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr,unsafeWindow.t_points);
for(var farm=0;farm1){
createElement("td",{"style":"text-align:right;"},newtr,"");
}
newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr,unsafeWindow.guildquestlist_level.replace(/:/,""));
for(var farm=0;farm1){
createElement("td",{"style":"text-align:right;"},newtr,"");
}
newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr,"Quest Farm 1");
for(var farm=0;farm1){
createElement("td",{"style":"text-align:right;"},newtr,"");
}
/*newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr,"Quest Farm 1 to");
for(var farm=0;farm1){
createElement("td",{"style":"text-align:right;"},newtr,"");
}
for(var v=0;v-1)){
if((bestand[farm][2][w]>-1)||(bestand[FARMNR][7][w]>0)){ showProduct = true; }
}
}
if(showProduct){
if(oldclass!=unsafeData.prodTyp[0][w]){
createElement("td",{"colspan":bestand.length+3},createElement("tr",{},newtable));
oldclass = unsafeData.prodTyp[0][w];
}
newtr = createElement("tr",{},newtable);
newtd = createElement("td",{},newtr);
produktPic(0,w,newtd);
if (!unsafeData.prodBlock[0][w].match(/[lt]/)){ // if (unsafeData.prodBlock[w].match(/^[lt]*$/)) {
newtd.setAttribute("mouseOverText",text[LNG]["goToMarketOfX"].replace("%1%",unsafeData.prodName[0][w]));
newa = createElement("span",{"id":w},newtd,unsafeData.prodName[0][w]);
//newa = createElement("a",{"id":w},newtd,unsafeData.prodName[0][w]);
//newa.setAttribute("class","link");
//newa.addEventListener("click",function(){showMarket(this.id);},false);
}else{
createElement("span",{"id":w},newtd,unsafeData.prodName[0][w]);
}
sum = 0;
for(var farm=0;farm-1){ //product amount
sum += bestand[farm][2][w];
if (bestand[farm][7].length > 1){
newtd = createElement("td",{"style":"text-align:right;"+(FARMNR==farm?"background-color:#CCCCFF;":"")},newtr);
createElement("span",{"style":"text-align:right;"},newtd,numberFormat(bestand[farm][2][w]));
if (!!bestand[farm][7][w] && bestand[farm][7][w]>0){
if ((bestand[farm][2][w] - bestand[farm][7][w])<0){
createElement("span",{"style":"color:#cc0000;"},newtd," ("+numberFormat(bestand[farm][2][w]-bestand[farm][7][w])+ ")");
}else{
createElement("span",{"style":"color:green;"},newtd," (+"+numberFormat(bestand[farm][2][w]-bestand[farm][7][w])+")");
}
}
}else{
createElement("td",{"style":"text-align:right;"+(FARMNR==farm?"background-color:#CCCCFF;":"")},newtr,numberFormat(bestand[farm][2][w]));
}
} else {
if (bestand[farm][7].length > 1){
newtd = createElement("td",{"style":"text-align:right;"+(FARMNR==farm?"background-color:#CCCCFF;":"")},newtr);
//createElement("span",{"style":"text-align:right;"},newtd,"--");
createElement("span",{"style":"text-align:right;color:blue;padding:0px 2px 0px 2px;"},newtd,"Lvl " + unsafeWindow.produkt_level[w]);
if (!!bestand[farm][7][w] && bestand[farm][7][w]>0){
createElement("span",{"style":"color:#cc0000;"},newtd,"( -"+numberFormat(bestand[farm][7][w])+ " )");
}
}else{
createElement("td",{"style":"text-align:right;"+(FARMNR==farm?"background-color:#CCCCFF;":"")},newtr,"--");
}
}
}
if(bestand.length>1){
createElement("td",{"style":"text-align:right;"},newtr,numberFormat(sum));
}
//createElement("td",{"style":"text-align:right;"},newtr,numberFormat(prodTotal[w]));
//createElement("td",{"style":"text-align:right;"},newtr,numberFormat(sum/prodTotal[w]*10000,0)+" "+sign_basepoint);
}
}
newtr = createElement("button",{"class":"link","style":"position:absolute;top:25px;left:450px"},div,"Clear all data");
newtr.addEventListener("click",function(){
FARMNR = 0;
bestand=[EMPTYFILE];
bestand[FARMNR][0]=FARMNAME;
for (var v=0;vThe Rackoverview-Script will not run properly.";
break;}
case "bu":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "de":{
if(top.unsafeData.text["de"]["rackoverview"]==undefined){
//text["de"]=new Object();
text["de"]["rackoverview"] = new Object();
text["de"]["rackoverview"]["msgUpdate"] = "Es liegt eine neue Script-Version vor rackoverview. Diese installieren?";
text["de"]["rackoverview"]["shouldUpdateBerater"] = "Du solltest das Berater-Script aktualisieren!
Der Rackoverview-Script wird nicht ordnungsgemaess arbeiten.";
}
break;}
case "dk":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "es": {
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "fr":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "gr":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "hu":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "it":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "nl":{
text["rackoverview"]["msgUpdate"] = "Wil je de nieuwe script versie van rackoverview installeren?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "pl":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "ru": {
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "se": {
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
case "tr":{
text["rackoverview"]["msgUpdate"] = "There is a new script version of rackoverview availible. Install?";
text["rackoverview"]["shouldUpdateBerater"] = "You should update the script of the Adviser!
The Rackoverview-Script will not run properly.";
break;}
}
// Updatecheck
if((!unsafeData.beraterVersion)||(compareVersions(neededVersionBerater,unsafeData.beraterVersion)>0)){
alert2(text[LNG]["rackoverview"]["shouldUpdateBerater"],text["ok"]);
}
// time,version on server,last checked version
var updateCheck=explode(GM_getValue("updateCheck"),"do_main/updateCheck",[0,VERSION,VERSION]);
//Update ausgeschaltet 22.03
/*
if(GM_getValue("valUpdate",true)&&(now-updateCheck[0]>1800)){
logBubble.add(getText("requestingUpdateInfoOfX").replace(/%1%/,GM_info["script"]["name"]));
updateCheck[0]=now;
GM_setValue2("updateCheck",implode(updateCheck),1);
GM_xmlhttpRequest({
method: "GET",
url: USO_Meta,
onload: function(response){
try{
if(response.responseText.match(/@version\s+\d+\.\d+\.\d+/)){
updateCheck[1]=(/@version\s+(\d+\.\d+\.\d+)/).exec(response.responseText)[1];
if(VERSION==updateCheck[1]){
// this script is the one of the server
updateCheck[2]=updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck),2);
logBubble.add(getText("XIsUpToDate").replace(/%1%/,GM_info["script"]["name"]));
}else if (updateCheck[1]!=updateCheck[2]){
alert2(getText("msgUpdateX").replace(/%1%/,GM_info["script"]["name"])+"
("+VERSION+" → "+updateCheck[1]+")",getText("yes"),getText("no"),function(){
updateCheck[2]=updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck),3);
window.setTimeout(function(){
location.href=USO_Source;
},0);
},function(){
updateCheck[2]=updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck),4);
});
}else{
logBubble.add(getText("updateOfXAvailable").replace(/%1%/,GM_info["script"]["name"]));
}
}else{
logBubble.add(getText("couldNotGetUpdateInfoOfX").replace(/%1%/,GM_info["script"]["name"]));
}
}catch(err){GM_logError("updateCheck.onload\n"+err);}
},
onerror: function(response){
GM_logError("updateCheck.onerror\n"+response.responseText);
},
timeout: function(response){
GM_logError("updateCheck.timeout\n"+response.responseText);
}
});
}*/
//08.03
/*
if(now-updateCheck[0]>1800){
showInLogBubble("Checking for update (Rackoverview)");
updateCheck[0] = now;
GM_setValue2("updateCheck",implode(updateCheck));
GM_xmlhttpRequest({
method: "GET",
url: USO_Meta,
onload: function(response) {
if(response.responseText.match(/@version\s+\d+\.\d+\.\d+/)){
updateCheck[1] = (/@version\s+(\d+\.\d+\.\d+)/).exec(response.responseText)[1];
if(VERSION==updateCheck[1]){
// this script is the one of the server
updateCheck[2] = updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck));
} else if (updateCheck[1]!=updateCheck[2]) {
alert2(text[LNG]["rackoverview"]["msgUpdate"]+"
("+VERSION+" → "+updateCheck[1]+")",text["yes"],text["no"],function(){
updateCheck[2] = updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck));
window.setTimeout(function(){
location.href = USO_Source;
},0);
},function(){
updateCheck[2] = updateCheck[1];
GM_setValue2("updateCheck",implode(updateCheck));
});
}
} else {
GM_log("Update Check Rackoverview: Bad Response: "+response.responseText);
}
}
});
}
*/
FARMNAME = $("username").innerHTML;
bestand = explode(GM_getValue(LNG+"_"+SERVER+"_rackoverview"),"bestand",[]);
if(!(bestand instanceof Array)){ bestand = new Array(); }
// FARMNAME, cash, products, points, level, quest
for(var v=0;v