View difference between Paste ID: Z1Mh8SK9 and MZqZHg0F
SHOW: | | - or go back to the newest paste.
1
/*
2-
2+
 
3
A GAME Mod by Hitler
4-
4+
 
5
  javascript:var s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='//pastebin.com/raw.php?i=HALDOL';void(0);
6-
6+
 
7
*/
8-
8+
 
9
'use strict';
10
function Mod(){
11-
	jQuery.fn.outerHTML = function(s) { return s ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); };
11+
        jQuery.fn.outerHTML = function(s) { return s ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); };
12-
	document.getElementById("employment").style['margin-top'] = "0px";
12+
        document.getElementById("employment").style['margin-top'] = "0px";
13-
	document.getElementsByName("items_holder")[0].style['margin-bottom'] = "0px";
13+
        document.getElementsByName("items_holder")[0].style['margin-bottom'] = "0px";
14-
	document.getElementById("vault_container").style.display = "none";
14+
        document.getElementById("lawmaker_upgrade_box").style.display = "none";
15-
	document.getElementById("vault_display").style.display = "none";
15+
        $('td[colspan="4"]').hide();
16-
	document.getElementById("upgrades_container").style.display = "none";
16+
        this.eff = 1;
17-
	document.getElementById("money_display").style.display = "none";
17+
        this.moneyGoal = 0;
18-
	$('div[name="characterIcon"]')[0].style.display="none";
18+
        this.buystr = "";
19-
	$('div[name="characterStats"]')[0].style.display="none";
19+
        this.refreshstr = "";
20-
	$('div[name="players"]')[0].style.display="none";
20+
        this.raidTarget = "";
21-
	$('h3:contains("Capacity")')[0].style.display="none";
21+
        this.money = 0;
22-
	this.oldOPM = 0;
22+
        this.prestige = 3;
23-
	this.buystr = "";
23+
        this.pickMoney = 15031305;
24-
	this.refreshstr = "";
24+
        this.workstr = "";
25-
	this.raidTarget = "";
25+
        this.RBstate = 0;  // 2 = RBcd  1 = RBwait 0 = RBgo 3 = lolwas
26-
	this.money = 0;
26+
        this.workerID = 88;
27-
	this.workstr = "";
27+
        this.allsteves = false;
28-
	this.RBstate = 0;  // 2 = RBcd  1 = RBwait 0 = RBgo 3 = lolwas
28+
        this.c = 1000;
29-
	this.workerID = 88;
29+
        this.limits= new Array(1000,900,800,700,600,600);
30-
	this.allsteves = false;
30+
        this.price= new Array(3000*(1+0.1*this.prestige),15000*(1+0.1*this.prestige),50000*(1+0.1*this.prestige),200000*(1+0.1*this.prestige),5000000*(1+0.1*this.prestige),15000000*(1+0.1*this.prestige),15000000000*(1+0.1*this.prestige));
31-
	this.c = 1000;
31+
        this.prods= new Array(106*(1+this.prestige/20),340*(1+this.prestige/20),1105*(1+this.prestige/20),8984*(1+this.prestige/20),23991*(1+this.prestige/20),35377*(1+this.prestige/20),35377*(1+this.prestige/20),38665*(1+this.prestige/20));
32-
	this.limits= new Array(1000,900,800,700,600,600);
32+
        //this.diffs= new Array(6,29,28,0,91,119);
33-
	this.price= new Array(3000,15000,50000,200000,5000000,15000000);
33+
        this.buildstr = "";
34-
	this.diffs= new Array(6,29,28,0,91,119);
34+
        this.scMoney = 0;
35-
	this.oldScnts = 0;
35+
        this.cWorker = true;
36-
	this.oldSaveDiff = 0;
36+
        this.GBstate = 7; // 0 = GBwait 1 = GBopen 2=GBlobby 3 = 3=GBrunning
37-
	this.buildstr = "";
37+
        this.timers = {
38-
	this.scMoney = 0;
38+
                update: false,
39-
	this.cWorker = true;
39+
                lastUpdate: +new Date,
40-
	this.GBstate = 7; // 0 = GBwait 1 = GBopen 2=GBlobby 3 = 3=GBrunning
40+
                oneSecondUpdate: 0,
41-
	this.timers = {
41+
                startTimer: +new Date,
42-
		update: false,
42+
                lobby: 0,
43-
		lastUpdate: +new Date,
43+
        };
44-
		oneSecondUpdate: 0,
44+
        // Updater
45-
		startTimer: +new Date,
45+
        this.timers.update = setInterval(function(){ this.update(); }.bind(this), 100);
46-
		lobby: 0,
46+
        // Elements
47-
	};
47+
        this.elements = {
48-
	// Updater
48+
                aboutBox: $('<div style="float:left;width:150px"><h4><div style="display:inline-block;margin-left:3px;vertical-align:top;"></div><div id="mod"></div></h4></div>'),
49-
	this.timers.update = setInterval(function(){ this.update(); }.bind(this), 100);
49+
        };
50-
	// Elements
50+
        $('<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js">').appendTo('body')
51-
	this.elements = {
51+
        $('#gamecontainer').prepend(this.elements.aboutBox);
52-
		aboutBox: $('<div style="float:left;width:150px"><h4><div style="display:inline-block;margin-left:3px;vertical-align:top;"></div><div id="mod"></div></h4></div>'),
52+
53-
	};
53+
 
54-
	$('<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js">').appendTo('body')
54+
 
55-
	$('#gamecontainer').prepend(this.elements.aboutBox);
55+
56
        if("undefined" === typeof _) return;
57-
57+
        var delta = (+new Date - this.timers.lastUpdate);
58-
58+
        this.timers.oneSecondUpdate += delta;
59
        if(this.timers.oneSecondUpdate > 1000){
60-
	if("undefined" === typeof _) return;
60+
                this.timers.oneSecondUpdate = 0;
61-
	var delta = (+new Date - this.timers.lastUpdate);
61+
                //var timeInfo = $('span[name="time"]').text().split(" ");
62-
	this.timers.oneSecondUpdate += delta;
62+
                //if((timeInfo[1].indexOf('minute')>-1) && (parseInt(timeInfo[0])>=3) && ((+new Date-this.timers.startTimer)>90000)){
63-
	if(this.timers.oneSecondUpdate > 1000){
63+
                //      this.refreshstr = "RR";
64-
		this.timers.oneSecondUpdate = 0;
64+
                //}
65-
		//var timeInfo = $('span[name="time"]').text().split(" ");
65+
                this.updateStats();
66-
		//if((timeInfo[1].indexOf('minute')>-1) && (parseInt(timeInfo[0])>=3) && ((+new Date-this.timers.startTimer)>90000)){
66+
                this.calcWorkers();
67-
		//	this.refreshstr = "RR";
67+
        }
68-
		//}
68+
        this.updateTitle();
69-
		this.updateStats();
69+
        this.timers.lastUpdate = +new Date;
70-
		this.calcWorkers();
70+
71-
	}
71+
 
72-
	this.updateTitle();
72+
73-
	this.timers.lastUpdate = +new Date;
73+
        this.workstr = '';
74
        var mgoal = 0;
75-
75+
        var bopm = (1+0.02*parseInt($('td[name="wopmtimesresearch"]').text().replace(/,/g,"")));
76
        var actualWorkers = new Array(0,0,0,0,0,0,0,0);
77-
	this.workstr = '';
77+
        var worker = 8;
78-
	if(!this.allsteves){
78+
        var prod = this.pickMoney-75000000/Math.ceil(this.eff);
79-
		if(this.cWorker){
79+
        for(var i = 0; i<8; i++){
80-
			var actualWorkers = new Array(0,0,0,0,0,0);
80+
                actualWorkers[i]=parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0]);
81-
			for(var i = 0; i<6; i++){
81+
                prod += actualWorkers[i]*this.prods[i]*bopm;
82-
				actualWorkers[i]=parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0])+this.diffs[i];
82+
        }
83-
			}
83+
        if(this.moneyGoal>0){
84-
			var smallest = 1337;
84+
                mgoal = this.moneyGoal;
85-
			for(var i = 5; i>=0; i--){
85+
        } else if(parseInt($('span[name="scientistTime"]').text())==10){
86-
				if((actualWorkers[i]<smallest)&&(parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0])<this.limits[i])){
86+
                mgoal = (5.9*Math.pow(10,12)-parseInt($('span[name="owned"]')[8].innerHTML.replace(/,/g,"")))*300 + Math.pow(10,15);
87-
					smallest = actualWorkers[i];
87+
        } else {
88-
					this.workerID = i;
88+
                for(var i = 5; i>=0; i--){
89-
				}
89+
                        if(parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0])<this.limits[i]){
90-
			}
90+
                                mgoal = this.price[i]*Math.pow(1.025,actualWorkers[i])/this.hasCL();
91-
			if(smallest==1337){
91+
                                worker = i;
92-
				this.allsteves=true;
92+
                                break;
93-
			}
93+
                        }
94-
		}
94+
                }
95-
		if(!this.allsteves){
95+
        }
96-
			this.cWorker = false;
96+
        var mmoney = mgoal-parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''));
97-
			if(parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''))>=(this.price[this.workerID] * (Math.pow(1.025, parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0]))))){
97+
        if(mgoal>0){
98-
				this.cWorker = true;
98+
                if(mmoney>0){
99-
				this.workstr = "#"+this.workerID;
99+
                        worker = 8;
100-
			}else if(parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''))>=(0.5 * this.price[this.workerID] * (Math.pow(1.025, parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0]))))){
100+
                        var smallest = mmoney/prod;
101-
				this.cWorker = true;
101+
                        for(var i = 0; i<6; i++){
102-
				this.workstr = "$"+this.workerID;
102+
                                if((mmoney+this.price[i]*Math.pow(1.025,actualWorkers[i])/this.hasCL())/(prod+bopm*this.prods[i])<smallest){
103-
			}
103+
                                        if(parseInt($('span[name="owned"]')[i].innerHTML.split(" ")[0])<this.limits[i]){
104-
		}
104+
                                        smallest = (mmoney+this.price[i]*Math.pow(1.025,actualWorkers[i])/this.hasCL())/(prod+bopm*this.prods[i]);
105-
	}
105+
                                        worker = i;
106
                                        }
107-
107+
                                }
108
                        }
109-
	var efffact = (Math.pow(1.01,parseInt($('span[name="owned"]')[12].innerHTML))-1)*parseFloat($('span[id="village-happiness"]')[0].innerHTML)/100+1;
109+
                        if(worker!=8){
110-
	var fontstr = "";
110+
                                console.log(Math.round(mmoney/prod-smallest) + "s ersparnis");
111-
	var fontstr2 = "";
111+
                                if((parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''))>=(this.price[worker] * (Math.pow(1.025, parseInt($('span[name="owned"]')[worker].innerHTML.split(" ")[0])))/this.hasCL()))){
112-
	for(var i = 0; i < $('span[name="item_details"]').length; i++){
112+
                                        this.workstr = "#"+worker;
113-
		if(($('span[name="item_details"]')[i].innerHTML.indexOf("Research Boost")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
113+
                                }
114-
			efffact *= 2;
114+
                        } else {
115-
			fontstr = "<font color='#00FF00'>";
115+
                                console.log(Math.round(smallest/60) + "min noch");
116-
			fontstr2 = "</font>";
116+
                        }
117-
		}else if(($('span[name="item_details"]')[i].innerHTML.indexOf("Diminishing Research")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
117+
                } else {
118-
			efffact *= 2;
118+
                        if(worker==8){
119-
			fontstr = "<font color='#00FF00'>";
119+
                                this.workstr = "$";
120-
			fontstr2 = "</font>";
120+
                        } else {
121-
		}
121+
                                this.workstr = "#"+worker;
122-
	}
122+
                        }
123-
	var scnts = parseInt($('span[name="scientists_owned"]').text())*efffact;
123+
                }
124-
	var ropm = parseInt($('td[name="wopmtimesresearch"]').text().replace(/,/g,""));
124+
        }
125-
	var scientistTime = parseInt($('span[name="scientistTime"]').text());
125+
        if(this.workstr===''){
126-
	var bossCurrency = parseInt($('td[id="bc_display"]').text().replace(/,/g,""));
126+
                this.workstr = worker;
127-
	var money = parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''));
127+
        }
128-
	//var
128+
129-
	if((ropm != this.oldOPM) || (scnts != this.oldScnts)){
129+
Mod.prototype.hasCL = function(){
130-
		var eff = this.c*ropm/(scientistTime*scnts);
130+
        var re = 1;
131-
		var rtime = Math.floor((Math.floor(scientistTime * scnts * Math.ceil(eff) / this.c) - ropm) * Math.ceil(eff) / 60);
131+
        for(var i = 0; i < $('span[name="item_details"]').length; i++){
132-
		//var ttime = Math.floor(100*(Math.pow(Math.ceil(eff),2)*27.5/this.c))/100;
132+
                if($('span[name="item_details"]')[i].innerHTML.indexOf("Cheap Labor")>-1) {
133-
		var buy = Math.ceil((Math.ceil(scnts*(eff/Math.floor(eff)-1)) - bossCurrency)/efffact);
133+
                        re = 2;
134-
		var sas = this.c/(Math.floor(eff)*Math.ceil(eff)*scientistTime*efffact);
134+
                        break;
135-
		var suus = (sas>=0.75) ? "NEVAR!" : Math.ceil(10*buy/(3600*(0.75-sas)))/10+"h"
135+
                }
136-
		if(buy<0){
136+
        }
137-
			this.buystr = ">";
137+
        return re;
138-
			document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*eff)/100000 + "s<br>" + fontstr2 + "<font color='#FF0000'>" + rtime + "min<br>KAUF MIT BC</font>";
138+
139-
		}else if((this.scMoney>0)&&(Math.ceil(2000*this.scMoney*(Math.pow(1.0005,buy)-1)-money)<0)){
139+
140-
			this.buystr = "<";
140+
        var efffact = 1; //(Math.pow(1.01,parseInt($('span[name="owned"]')[13].innerHTML))-1)*parseFloat($('span[id="village-happiness"]')[0].innerHTML)/100+1;
141-
			document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*eff)/100000 + "s<br>" + fontstr2 + "<font color='#FF0000'>" + rtime + "min<br>"+buy+"\u262d - "+ suus + "<br>KAUF MIT $$$</font>";
141+
        var fontstr = "";
142-
		}else{
142+
        var fontstr2 = "";
143-
			this.buystr = "";
143+
        for(var i = 0; i < $('span[name="item_details"]').length; i++){
144-
			document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*eff)/100000 + "s<br>" + fontstr2 + rtime + "min<br>"+buy+"\u262d - "+suus;
144+
                if(($('span[name="item_details"]')[i].innerHTML.indexOf("Research Boost")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
145-
		}
145+
                        efffact *= 2;
146-
		this.oldScnts = scnts;
146+
                        fontstr = "<font color='#00FF00'>";
147-
		this.oldOPM = ropm;
147+
                        fontstr2 = "</font>";
148-
	}
148+
                }else if(($('span[name="item_details"]')[i].innerHTML.indexOf("Diminishing Research")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
149-
	if(this.buystr==""){
149+
                        efffact *= 2;
150-
		if(money>(Math.pow(1.2,parseInt($('span[name="owned"]')[14].innerHTML))*800000000000)){
150+
                        fontstr = "<font color='#00FF00'>";
151-
			this.buystr = ")";
151+
                        fontstr2 = "</font>";
152-
		//}else if(money>(Math.pow(1.2,parseInt($('span[name="owned"]')[12].innerHTML))*560000000000)){
152+
                }
153-
		//	this.buystr = "(";
153+
        }
154-
		} else if(parseInt($('span[name="owned"]')[8].innerHTML.replace(/,/g,""))<Math.pow(10,10)){
154+
        var scnts = parseInt($('span[name="scientists_owned"]').text())*efffact;
155-
			this.buystr = "/";
155+
        var ropm = parseInt($('td[name="wopmtimesresearch"]').text().replace(/,/g,""));
156-
		} else if(parseInt($('span[name="owned"]')[9].innerHTML.replace(/,/g,""))<Math.pow(10,9)){
156+
        var scientistTime = parseInt($('span[name="scientistTime"]').text());
157-
			this.buystr = "\\";
157+
        var bossCurrency = parseInt($('td[id="bc_display"]').text().replace(/,/g,""))/(3-this.hasCL());
158-
		}
158+
        var money = parseInt($('td[id="money_display"]').text().replace(/,/g,'').replace('$',''));
159-
	}
159+
        this.eff = this.c*ropm/(scientistTime*scnts);
160
        var buy = Math.ceil((Math.ceil(scnts*(this.eff/Math.floor(this.eff)-1)) - bossCurrency)/efffact);
161-
161+
        var rtime = Math.floor((Math.floor(scientistTime * scnts * Math.ceil(this.eff) / this.c) - ropm) * Math.ceil(this.eff) / 60);
162
        var sas = this.c/(Math.floor(this.eff)*Math.ceil(this.eff)*scientistTime*efffact);
163-
	//RB
163+
        var suus = (sas>=0.75) ? "NEVAR!" : Math.ceil(10*buy/(3600*(0.75-sas)))/10+"h";
164-
	if($('span[name="timer"][style="font-size: 19px; display: inline;"').length==1){
164+
 
165-
		this.RBstate = 2;
165+
        if(parseInt($('span[name="owned"]')[8].innerHTML.replace(/,/g,""))<(Math.pow(10,7))){
166-
	} else if((this.RBstate==2)&&($('div[id="popup"]:contains("SCENARIO")').length==1)) {
166+
                this.buystr = "/";
167-
		this.RBstate = 3;
167+
        } else if(parseInt($('span[name="owned"]')[9].innerHTML.replace(/,/g,""))<(5*Math.pow(10,6))){
168-
	} else if(((this.RBstate==0)&&($('div[id="popup"]:contains("SCENARIO")').length==1))||((document.getElementById("mining_container").style.display!=="none")&&($('body')[0].style["background-color"]=="rgb(15, 39, 41)"))) {
168+
                this.buystr = "\\";
169-
		this.RBstate = 1;
169+
        } else if(buy<0){
170-
	} else if((this.RBstate==2)||(($('div[id="popup"]:contains("SCENARIO")').length==0)&&(this.RBstate==3))) {
170+
                this.buystr = ">";
171-
		this.RBstate = 0;
171+
                document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*this.eff)/100000 + "s<br>" + fontstr2 + "<font color='#FF0000'>" + rtime + "min<br>KAUF MIT BC</font>";
172-
	}
172+
        }else if((this.scMoney>0)&&(Math.ceil(2000*this.scMoney*(Math.pow(1.0005,buy)-1)-money)<0)){
173-
	var RBstr = '';
173+
                this.buystr = "<";
174-
	if($('body')[0].style["background-color"]!=="rgb(15, 39, 41)"){
174+
                document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*this.eff)/100000 + "s<br>" + fontstr2 + "<font color='#FF0000'>" + rtime + "min<br>"+buy+"\u262d - "+ suus + "<br>KAUF MIT $$$</font>";
175-
		RBstr = "PP";
175+
        }else{
176-
	}else if((document.getElementById("mining_container").style.display!=="none")&&($('body')[0].style["background-color"]=="rgb(15, 39, 41)")){
176+
                this.buystr = "";
177-
		RBstr = "R3";
177+
                document.getElementById("mod").innerHTML = "<br><br>" + fontstr + "eff: " + Math.round(100000*this.eff)/100000 + "s<br>" + fontstr2 + rtime + "min<br>"+buy+"\u262d - "+suus;
178-
	}else if(this.RBstate==2){
178+
        }
179-
		RBstr = "R2";
179+
180-
	} else if(this.RBstate==1){
180+
 
181-
		RBstr = "R1";
181+
182-
	} else if((this.RBstate==0)||(this.RBstate==3)){
182+
        //RB
183-
		RBstr = "R0";
183+
        if($('span[name="timer"][style="font-size: 19px; display: inline;"').length==1){
184-
	}
184+
                this.RBstate = 2;
185-
	var popupHTML = $('div[id="popup"]')[0].innerHTML;
185+
        } else if((this.RBstate==2)&&($('div[id="popup"]:contains("SCENARIO")').length==1)) {
186-
	//GB
186+
                this.RBstate = 3;
187-
	if($('img[name="globalBossImg"]:visible').length==1){
187+
        } else if(((this.RBstate==0)&&($('div[id="popup"]:contains("SCENARIO")').length==1))||((document.getElementById("mining_container").style.display!=="none")&&($('body')[0].style["background-color"]=="rgb(15, 39, 41)"))) {
188-
		this.GBstate = 3;
188+
                this.RBstate = 1;
189-
	} else if ($('img[src="game/img/icons/globalBoss_big.png"]:visible').length==1){
189+
        } else if((this.RBstate==2)||(($('div[id="popup"]:contains("SCENARIO")').length==0)&&(this.RBstate==3))) {
190-
		this.GBstate = 2;
190+
                this.RBstate = 0;
191-
	} else if (($('span[name="timeRemaining"]').text()==("JOIN"||"LEAVE"))&&((this.GBstate==2)||(this.GBstate==0))){
191+
        }
192-
		if(this.GBstate==0){this.timers.lobby = +new Date;}
192+
        var RBstr = '';
193-
		this.GBstate = 1;
193+
        if($('body')[0].style["background-color"]!=="rgb(15, 39, 41)"){
194-
	} else if (($('span[name="timeRemaining"]').text().indexOf("min")>-1)||($('span[name="timeRemaining"]').text().indexOf("sec")>-1)){
194+
                RBstr = "PP";
195-
		this.GBstate = 0;
195+
        }else if((document.getElementById("mining_container").style.display!=="none")&&($('body')[0].style["background-color"]=="rgb(15, 39, 41)")){
196-
	} else if ((popupHTML.indexOf("You cannot join the event lobby")>-1)||((this.GBstate>0)&&(this.GBstate<5)&&((+new Date-this.timers.lobby)>61000))){
196+
                RBstr = "R3";
197-
		this.GBstate = 6;
197+
        }else if(this.RBstate==2){
198-
	}
198+
                RBstr = "R2";
199-
	var GBstr = '';
199+
        } else if(this.RBstate==1){
200-
	if(this.GBstate==0){
200+
                RBstr = "R1";
201-
		GBstr = 'G0';
201+
        } else if((this.RBstate==0)||(this.RBstate==3)){
202-
	}else if(this.GBstate==1){
202+
                RBstr = "R0";
203-
		GBstr = 'G1';
203+
        }
204-
		if((+new Date-this.timers.lobby)>54000){GBstr='G3';}
204+
        var popupHTML = $('div[id="popup"]')[0].innerHTML;
205-
	}else if(this.GBstate==2){
205+
        //GB
206-
		GBstr = 'G2';
206+
        if($('img[name="globalBossImg"]:visible').length==1){
207-
		if((+new Date-this.timers.lobby)>54000){GBstr='G4';}
207+
                this.GBstate = 3;
208-
	}else if(this.GBstate==3){
208+
        } else if ($('img[src="game/img/icons/globalBoss_big.png"]:visible').length==1){
209-
		GBstr = 'G5';
209+
                this.GBstate = 2;
210-
	}else if(this.GBstate==7){
210+
        } else if (($('span[name="timeRemaining"]').text()==("JOIN"||"LEAVE"))&&((this.GBstate==2)||(this.GBstate==0))){
211-
		GBstr = 'G7';
211+
                if(this.GBstate==0){this.timers.lobby = +new Date;}
212-
	}else if(this.GBstate==6){
212+
                this.GBstate = 1;
213-
		GBstr = 'G6';
213+
        } else if (($('span[name="timeRemaining"]').text().indexOf("min")>-1)||($('span[name="timeRemaining"]').text().indexOf("sec")>-1)){
214-
	}
214+
                this.GBstate = 0;
215-
	//Inventory
215+
        } else if ((popupHTML.indexOf("You cannot join the event lobby")>-1)||((this.GBstate>0)&&(this.GBstate<5)&&((+new Date-this.timers.lobby)>61000))){
216-
	var ItemString = '';
216+
                this.GBstate = 6;
217-
	for(var i = 0; i < $('span[name="item_details"]').length; i++){
217+
        }
218-
		var activated = ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1);
218+
        var GBstr = '';
219-
		if($('span[name="item_details"]')[i].innerHTML.indexOf("Ring of Efficiency")>-1) {
219+
        if(this.GBstate==0){
220-
			ItemString += activated ? ':' : '.';
220+
                GBstr = 'G0';
221-
		}else if($('span[name="item_details"]')[i].innerHTML.indexOf("Cheap Labor")>-1) {
221+
        }else if(this.GBstate==1){
222-
			ItemString += activated ? 'I' : 'i';
222+
                GBstr = 'G1';
223-
		}else if($('span[name="item_details"]')[i].innerHTML.indexOf("Double XP")>-1) {
223+
                if((+new Date-this.timers.lobby)>45000){GBstr='G3';}
224-
			ItemString += '%';
224+
        }else if(this.GBstate==2){
225-
		}else if($('span[name="item_details"]')[i].innerHTML.indexOf("Attack Boost")>-1) {
225+
                GBstr = 'G2';
226-
			ItemString += '&';
226+
                if((+new Date-this.timers.lobby)>45000){GBstr='G4';}
227-
		}else if($('span[name="item_details"]')[i].innerHTML.indexOf("Godspear Fragment")>-1) {
227+
        }else if(this.GBstate==3){
228-
			ItemString += activated ? ',' : '*';
228+
                GBstr = 'G5';
229-
		}else{
229+
        }else if(this.GBstate==7){
230-
			ItemString += activated ? ',' : '!';
230+
                GBstr = 'G7';
231-
		}
231+
        }else if(this.GBstate==6){
232-
	}
232+
                GBstr = 'G6';
233-
	//raiding
233+
        }
234-
	var raidstr = '';
234+
        //Inventory
235-
	if($('span[name="raidtime"]')[0].innerHTML==""){
235+
        var ItemString = '';
236-
		if(this.raidTarget==""){
236+
        for(var i = 0; i < $('span[name="item_details"]').length; i++){
237-
			raidstr = "?";
237+
                var activated = ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1);
238-
		} else {
238+
                if($('span[name="item_details"]')[i].innerHTML.indexOf("Ring of Efficiency")>-1) {
239-
			raidstr = "_";
239+
                        ItemString += activated ? ':' : '.';
240-
		}
240+
                }else if($('span[name="item_details"]')[i].innerHTML.indexOf("Cheap Labor")>-1) {
241-
	}
241+
                        ItemString += activated ? 'I' : 'i';
242-
	//popup
242+
                }else if($('span[name="item_details"]')[i].innerHTML.indexOf("Double XP")>-1) {
243-
	var popupstr = '';
243+
                        ItemString += activated ? '`' : '%';
244-
	if($('div[id="popup"]:visible').length==1){
244+
                }else if($('span[name="item_details"]')[i].innerHTML.indexOf("Attack Boost")>-1) {
245-
		if(popupHTML.indexOf("Raid report")>-1){
245+
                        ItemString += activated ? '`' : '&';
246-
			popupstr = '~' + popupHTML.slice(popupHTML.indexOf("You"),popupHTML.indexOf("</div>")).trim();
246+
                }else if($('span[name="item_details"]')[i].innerHTML.indexOf("Godspear Fragment")>-1) {
247-
		} else {
247+
                        ItemString += activated ? ',' : '*';
248-
			popupstr = '^';
248+
                }else{
249-
			if(popupHTML.indexOf("You are already fighting a boss")>-1){
249+
                        ItemString += activated ? '`' : '!';
250-
				this.RBstate==1;
250+
                }
251-
			} else if((popupHTML.indexOf("What user do you want to raid")>-1)&&($('input[name="raid_user"]')[0].value!=this.raidTarget)&&(this.raidTarget!="")){
251+
        }
252-
				$('input[name="raid_user"]')[0].value = this.raidTarget;
252+
        //raiding
253-
			}
253+
        var raidstr = '';
254-
		}
254+
        /*if($('span[name="raidtime"]')[0].innerHTML==""){
255-
	}
255+
                if(this.raidTarget==""){
256-
	//scMoney
256+
                        raidstr = "?";
257-
	var scstr = '';
257+
                } else {
258-
	if($('span[name="scientists_price"]')[0].innerHTML.indexOf("$")==0){
258+
                        raidstr = "_";
259-
		scstr = '@';
259+
                }
260-
		this.scMoney = parseInt($('span[name="scientists_price"]').text().replace(/,/g,'').replace('$',''));
260+
        }
261-
	} else if(this.scMoney==0){
261+
        */
262-
		scstr = '=';
262+
        //popup
263-
	}
263+
        var popupstr = '';
264-
	window.document.title = ItemString + "|" + this.refreshstr + this.workstr + scstr + this.buystr + GBstr + raidstr + RBstr + popupstr + '| A GAME';
264+
        if($('div[id="popup"]:visible').length==1){
265
                if((popupHTML.indexOf("Raid report")>-1)||(popupHTML.indexOf("Chikolio")>-1)){
266
                        popupstr = '~' + popupHTML.slice(popupHTML.indexOf("You"),popupHTML.indexOf("</div>")).trim();
267-
	_.each(this.elements, function(element){
267+
                } else {
268-
		if(_.isArray(element)){
268+
                        popupstr = '^';
269-
			_.each(element, function(el){ el.remove(); });
269+
                        if(popupHTML.indexOf("You are already fighting a boss")>-1){
270-
		}else{
270+
                                this.RBstate==1;
271-
			element.remove();
271+
                        } else if((popupHTML.indexOf("What user do you want to raid")>-1)&&($('input[name="raid_user"]')[0].value!=this.raidTarget)&&(this.raidTarget!="")){
272-
		}
272+
                                $('input[name="raid_user"]')[0].value = this.raidTarget;
273-
	});
273+
                        }
274-
	clearInterval(this.timers.update);
274+
                }
275-
	window.mod = undefined;
275+
        }
276
        //scMoney
277-
277+
        var scstr = '';
278
        if($('span[name="scientists_price"]')[0].innerHTML.indexOf("$")==0){
279
                scstr = '@';
280
                this.scMoney = parseInt($('span[name="scientists_price"]').text().replace(/,/g,'').replace('$',''));
281
        } else if(this.scMoney==0){
282
                scstr = '=';
283
        }
284
        window.document.title = ItemString + "|" + this.refreshstr + this.workstr + scstr + this.buystr + GBstr + raidstr + RBstr + popupstr + '| A GAME';
285
}
286
Mod.prototype.terminate = function(){
287
        _.each(this.elements, function(element){
288
                if(_.isArray(element)){
289
                        _.each(element, function(el){ el.remove(); });
290
                }else{
291
                        element.remove();
292
                }
293
        });
294
        clearInterval(this.timers.update);
295
        window.mod = undefined;
296
}
297
 
298
// Start
299
if(window.mod) window.mod.terminate();
300
window.mod = new Mod();