View difference between Paste ID: 01gtXsm4 and nRqJyb9s
SHOW: | | - or go back to the newest paste.
1
/*
2
A MAP GAME Mod by Rebin
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
*/
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");
11+
	window.document.title='|MIAU A GAME';
12-
	this.max = this.getKeks(this.pow +"!max");
12+
13-
	this.min = this.getKeks(this.pow +"!min");
13+
14-
	this.oldmists = -1;
14+
15-
	window.document.title='|MAP A GAME';
15+
16
	if(typeof(game) != "undefined"){
17
		if(game.loaded){
18
			clearInterval(this.initTimer);
19
			this.init();
20
		}
21
	}
22
}
23
24
Mod.prototype.init = function(){
25
	// TIMERS
26
	this.timers = {
27
		update: false,
28
	};
29
	// Updater
30
	this.timers.update = setInterval(function(){ this.update(); }.bind(this), 42);
31
	// check
32
	console.log(game.adventure.stages - game.adventure.stage + " stages left");
33
}
34
Mod.prototype.update = function(){
35
	if("undefined" === typeof _) return;
36-
	if((this.max-this.min)<=100000){
36+
	if(game.adventure.stage == 0){
37-
		this.pow--;
37+
		this.setKeks("result#",this.getKeks("result#")+1);
38-
		if(this.pow < 5){
38+
		this.setKeks("result"+game.adventure.reward,this.getKeks("result"+game.adventure.reward)+1);  
39-
			window.document.title =  '>>> |MAP A GAME';
39+
40-
			clearInterval(this.timers.update);
40+
		location.reload();
41-
		} else {
41+
42-
			this.setKeks("#lastPow",this.pow);
42+
43-
			this.max = this.getKeks(this.pow +"!max");
43+
44-
			this.min = this.getKeks(this.pow +"!min");
44+
45
    if(parts.length == 2){
46
        return parseInt(parts.pop().split(";").shift());
47-
	this.advmoney = Math.floor((this.max+this.min)/2);
47+
48-
	this.killstr = Math.ceil(-(Math.log10(this.max-this.min)-5)/Math.log10(0.5)) + " : " + this.pow + "m";
48+
49
}
50
Mod.prototype.setKeks = function(Bezeichner,Wert){
51
    document.cookie=Bezeichner+"="+Wert+";expires=Fri, 16 Oct 2222 14:19:54 GMT;";
52-
	var popupstr = "";
52+
53-
	if(this.killstr != ">>>"){
53+
54-
		if($('div[id="popup"]:visible').length==1){
54+
55-
			var popupHTML = $('div[id="popup"]')[0].innerHTML;
55+
56-
			if(popupHTML.indexOf("What will you offer")>-1){
56+
57-
				if(this.oldmists < 0){
57+
58-
					this.oldmists = game.villages[game.currentVillage].employed.adv_miner[0];
58+
59
				}
60-
				if($('input[id="advArmy-knight"]')[0].value!=this.advmoney){
60+
61-
					$('input[id="advArmy-knight"]')[0].value = this.advmoney;
61+
62-
				} else {
62+
63-
					popupstr = "+";
63+
64-
				} 
64+
65-
			} else if(popupHTML.indexOf("Do you want to offer some of your troops")>-1){
65+