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