View difference between Paste ID: NgvJm66K and qmew8L7Q
SHOW: | | - or go back to the newest paste.
1
/*
2
A MAP GAME Mod by Rebin
3-
A GAME Mod by Hitler
3+
4
javascript:var s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='//pastebin.com/raw.php?i=NgvJm66K';void(0);
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);
5+
6
7
'use strict';
8
function Mod(){
9
	$('<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js">').appendTo('body')
10
	jQuery.fn.outerHTML = function(s) { return s ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); };
11
	this.pow = this.getKeks("#lastPow");
12
	this.total = this.getKeks(this.pow +"!ALL");
13-
	this.version = 433;
13+
	this.limit = this.getKeks("#limit");
14-
	window.document.title='| A GAME';
14+
	this.oldmists = -1;
15
	window.document.title='|MAP A GAME';
16
	this.initTimer = setInterval(function(){ this.checkInit(); }.bind(this), 20);
17
}
18
19
Mod.prototype.checkInit = function(){
20
	if(typeof(game) != "undefined"){
21-
			if(game.adventure.stage > 0){console.log(game.adventure.stages - game.adventure.stage + " stages left");}
21+
22
			clearInterval(this.initTimer);
23
			this.init();
24
		}
25
	}
26
}
27
28
Mod.prototype.init = function(){
29-
	console.log("VERSION " + this.version);
29+
	this.maxpow = 34;
30-
	// DISPLAY STUFF
30+
	while(this.total >= this.limit){
31-
	$('div[name="character"]').show();
31+
		if(this.pow == this.maxpow){
32-
	document.getElementById("employment").style['margin-top'] = "0px";
32+
			if(this.limit == 1000){ 
33-
	document.getElementById("employment").style['margin-bottom'] = "150px";
33+
				this.killstr = ">>>";
34-
	document.getElementsByName("items_holder")[0].style['margin-bottom'] = "0px";
34+
35-
	$('div[id="upgrades_container"]').hide();  //////--------- remove at prestiging
35+
				this.update();
36-
	$('td[colspan="4"]').hide();
36+
37-
	var css = document.createElement("style");
37+
				this.pow = 27;
38-
	css.type = "text/css";
38+
				this.setKeks("#lastPow",27);
39-
	css.innerHTML = "span[name=attackedSpan] { pointer-events: none; }";
39+
				this.total = this.getKeks("27!ALL");
40-
	document.body.appendChild(css);
40+
				this.limit += 100;
41-
	// VARS
41+
				this.setKeks("#limit",this.limit);
42-
	this.eff = 1;
42+
43-
	this.GBstate = 7; // 0 = GBwait 1 = GBopen 2=GBlobby 3 = 3=GBrunning
43+
44-
	this.RBstate = 0;  // 2 = RBcd  1 = RBwait 0 = RBgo 3 = lolwas
44+
			this.pow++;
45-
	this.advarmy = 987654321000;
45+
			this.setKeks("#lastPow",this.pow);
46-
	this.buystr = "";
46+
			this.total = this.getKeks(this.pow+"!ALL");
47-
	this.ItemString = "";
47+
48-
	this.forcedReward = this.getKeks("forcedReward");
48+
49-
	this.retrying = this.getKeks("#retrying");
49+
	this.killstr = this.pow;
50-
	this.forcedWhisper = 2; // where 1 is built and 2 is equally
50+
	//this.adv_ninjapow = 11;
51-
	this.rewardDiff = 88;
51+
	this.adv_sac = Math.ceil(Math.pow(10,11)*Math.pow(Math.E,this.pow)/5000).toLocaleString().replace(/\./g,"");
52-
	this.donateMax = Math.pow(10,21)-65537;
52+
53-
	this.donateOpt = 48516519540978990000;
53+
54-
	this.mapstr = "";
54+
55-
	this.newVilDelta = this.getKeks("newVilDelta");
55+
56-
	this.oldmists = game.villages[game.currentVillage].employed.adv_miner[0];
56+
57-
	this.oldGBM = game.villages[game.currentVillage].employed.gb_capturedminion[0];
57+
	this.timers.update = setInterval(function(){ this.update(); }.bind(this), 42);
58-
	this.savedMaps = 0;
58+
59-
	this.startAdv = false;
59+
60-
	this.waitForSave = false;
60+
61-
	this.advStarted = false;
61+
62-
	this.activateCL = false;
62+
	var popupstr = "";
63-
	this.removeAttackBoost = false;
63+
	if(this.killstr != ">>>"){
64-
	this.attackBoostLife = 0;
64+
		if($('div[id="popup"]:visible').length==1){
65-
	this.saveDiff = game.lastMine - game.lastSave;
65+
			var popupHTML = $('div[id="popup"]')[0].innerHTML;
66-
	this.mapState = (game.adventure.reward > 0) ? 2 : ((game.adventure.stage > 0) ? 1 : 0);
66+
			if(popupHTML.indexOf("What will you offer")>-1){
67
				if(this.oldmists < 0){
68
					this.oldmists = game.villages[game.currentVillage].employed.adv_miner[0];
69
				}
70-
		lobby: 0,
70+
				if($('input[id="advArmy-templar"]')[0].value!=this.adv_sac){
71-
		GB: 0,
71+
					$('input[id="advArmy-templar"]')[0].value = this.adv_sac;
72
				} else {
73
					popupstr = "#";
74-
	this.timers.update = setInterval(function(){ this.update(); }.bind(this), 100);
74+
				} 
75
			} else if(popupHTML.indexOf("Do you want to offer some of your troops")>-1){
76-
	this.elements = {
76+
				popupstr = "+"
77-
		aboutBox: $('<div style="float:left;width:250px"><h4><div style="display:inline-block;margin-left:3px;vertical-align:top;"></div><div id="mod"></div></h4></div>'),
77+
			} else if(popupHTML.indexOf("A whisper is heard: ")>-1){
78
				var whisper = $('div[name="content"]')[0].innerHTML.slice(20,666)
79-
	$('#gamecontainer').prepend(this.elements.aboutBox);
79+
				var result = this.pow + whisper;
80
				if (whisper.indexOf("built upon our efforts")>-1){
81
					var newmists = game.villages[game.currentVillage].employed.adv_miner[0] - this.oldmists;
82
					if(newmists > 0){
83
						this.setKeks(this.pow+"!miners"+newmists,this.getKeks(this.pow+"!miners"+newmists)+1);
84-
	if(game.money != this.oldMoney){
84+
						this.setKeks(this.pow + "!ALL",this.total + 1);
85-
		var newSaveDiff = game.lastMine - game.lastSave;
85+
						this.setKeks(this.pow + "!miner", (this.getKeks(this.pow + "!miner") + 1));
86-
		if(newSaveDiff < this.saveDiff){
86+
						clearInterval(this.timers.update);
87-
			this.waitForSave = false;
87+
						location.reload();
88-
			console.log("saved at "+(new Date()).toGMTString());
88+
89
				} else {
90-
		this.saveDiff = newSaveDiff;
90+
					if(whisper.indexOf("equally")>-1){
91-
		this.oldMoney = game.money;
91+
						this.setKeks(this.pow+"!equal",this.getKeks(this.pow+"!equal")+1);
92-
		this.updateStats();
92+
93-
		this.updateInventory();
93+
					this.setKeks(this.pow+"!ALL",this.total + 1);
94-
		this.updateMap();
94+
95-
		this.updateTitle();
95+
96-
		var addmists = game.villages[game.currentVillage].employed.adv_miner[0] - this.oldmists;
96+
97-
		if((addmists > 0)&&(addmists < 21)){
97+
98-
			clearInterval(this.timers.update);
98+
99-
			location.reload();
99+
100
	window.document.title =  this.killstr + popupstr + '|MAP A GAME';
101-
		if(game.villages[game.currentVillage].employed.gb_capturedminion[0] > this.oldGBM){
101+
102-
			this.waitForSave = true;
102+
103
    var parts = document.cookie.split(" " + name + "=");
104-
		this.oldGBM = game.villages[game.currentVillage].employed.gb_capturedminion[0];
104+
    if(parts.length == 2){
105-
		this.oldmists = game.villages[game.currentVillage].employed.adv_miner[0];
105+
        return parseInt(parts.pop().split(";").shift());
106
    }
107
    return 0;
108
}
109-
Mod.prototype.updateStats = function(){
109+
110-
	var vil = game.villages[game.currentVillage];
110+
    document.cookie=Bezeichner+"="+Wert+";expires=Fri, 16 Oct 2222 14:19:54 GMT;";
111-
	var fact = (Math.pow(1.01,vil.buildings.library)-1)*(vil.setup.happiness/100) + 1;
111+
112-
	var fontstr = "";
112+
113-
	var fontstr2 = "";
113+
114-
	for(var i = 0; i < $('span[name="item_details"]').length; i++){
114+
115-
		if(($('span[name="item_details"]')[i].innerHTML.indexOf("Research Boost")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
115+
116-
			fact *= 2;
116+
117-
			fontstr = "<font color='#00FF00'>";
117+
118-
			fontstr2 = "</font>";
118+
119-
		}else if(($('span[name="item_details"]')[i].innerHTML.indexOf("Diminishing Research")>-1) && ($('span[name="item_details"]')[i].innerHTML.indexOf("activate")==-1)) {
119+
120-
			fact *= 2;
120+
121-
			fontstr = "<font color='#00FF00'>";
121+
122-
			fontstr2 = "</font>";
122+
123
// Start
124
if(!window.m){window.m = new Mod();}