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')
|
| 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"); |
| 12 | + | this.max = this.getKeks(this.pow +"!max"); |
| 13 | - | this.limit = this.getKeks("#limit");
|
| 13 | + | this.min = this.getKeks(this.pow +"!min"); |
| 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.loaded){
| |
| 22 | clearInterval(this.initTimer); | |
| 23 | this.init(); | |
| 24 | } | |
| 25 | } | |
| 26 | } | |
| 27 | ||
| 28 | Mod.prototype.init = function(){
| |
| 29 | - | this.maxpow = 34; |
| 29 | + | |
| 30 | - | while(this.total >= this.limit){
|
| 30 | + | |
| 31 | - | if(this.pow == this.maxpow){
|
| 31 | + | |
| 32 | - | if(this.limit == 1000){
|
| 32 | + | |
| 33 | - | this.killstr = ">>>"; |
| 33 | + | |
| 34 | - | clearInterval(this.timers.update); |
| 34 | + | |
| 35 | - | this.update(); |
| 35 | + | // check |
| 36 | - | } else {
|
| 36 | + | if((this.max-this.min)<=100000){
|
| 37 | - | this.pow = 27; |
| 37 | + | this.pow--; |
| 38 | - | this.setKeks("#lastPow",27);
|
| 38 | + | if(this.pow < 5){
|
| 39 | - | this.total = this.getKeks("27!ALL");
|
| 39 | + | window.document.title = '>>> |MAP A GAME'; |
| 40 | - | this.limit += 100; |
| 40 | + | clearInterval(this.timers.update); |
| 41 | - | this.setKeks("#limit",this.limit);
|
| 41 | + | |
| 42 | this.setKeks("#lastPow",this.pow);
| |
| 43 | this.max = this.getKeks(this.pow +"!max"); | |
| 44 | - | this.pow++; |
| 44 | + | this.min = this.getKeks(this.pow +"!min"); |
| 45 | } | |
| 46 | - | this.total = this.getKeks(this.pow+"!ALL"); |
| 46 | + | |
| 47 | this.advmoney = Math.floor((this.max+this.min)/2); | |
| 48 | this.killstr = Math.ceil(-(Math.log10(this.max-this.min)-5)/Math.log10(0.5)) + " : " + this.pow + "m"; | |
| 49 | - | this.killstr = this.pow; |
| 49 | + | |
| 50 | - | //this.adv_ninjapow = 11; |
| 50 | + | |
| 51 | - | this.adv_sac = Math.ceil(Math.pow(10,11)*Math.pow(Math.E,this.pow)/5000).toLocaleString().replace(/\./g,""); |
| 51 | + | |
| 52 | var popupstr = ""; | |
| 53 | if(this.killstr != ">>>"){
| |
| 54 | if($('div[id="popup"]:visible').length==1){
| |
| 55 | var popupHTML = $('div[id="popup"]')[0].innerHTML;
| |
| 56 | if(popupHTML.indexOf("What will you offer")>-1){
| |
| 57 | if(this.oldmists < 0){
| |
| 58 | - | // Elements |
| 58 | + | |
| 59 | } | |
| 60 | if($('input[id="advArmy-knight"]')[0].value!=this.advmoney){
| |
| 61 | $('input[id="advArmy-knight"]')[0].value = this.advmoney;
| |
| 62 | } else {
| |
| 63 | popupstr = "+"; | |
| 64 | } | |
| 65 | } else if(popupHTML.indexOf("Do you want to offer some of your troops")>-1){
| |
| 66 | popupstr = "+" | |
| 67 | } else if(popupHTML.indexOf("A whisper is heard: ")>-1){
| |
| 68 | var whisper = $('div[name="content"]')[0].innerHTML.slice(20,666)
| |
| 69 | if (whisper.indexOf("built upon our efforts")>-1){
| |
| 70 | - | if($('input[id="advArmy-templar"]')[0].value!=this.adv_sac){
|
| 70 | + | |
| 71 | - | $('input[id="advArmy-templar"]')[0].value = this.adv_sac;
|
| 71 | + | if(newmists == (this.pow - 1)){
|
| 72 | this.setKeks(this.pow +"!min", this.advmoney); | |
| 73 | - | popupstr = "#"; |
| 73 | + | } else if(newmists == this.pow){
|
| 74 | this.setKeks(this.pow +"!max", this.advmoney); | |
| 75 | } | |
| 76 | if(newmists > 0){
| |
| 77 | clearInterval(this.timers.update); | |
| 78 | location.reload(); | |
| 79 | - | var result = this.pow + whisper; |
| 79 | + | |
| 80 | } else {
| |
| 81 | clearInterval(this.timers.update); | |
| 82 | location.reload(); | |
| 83 | - | this.setKeks(this.pow+"!miners"+newmists,this.getKeks(this.pow+"!miners"+newmists)+1); |
| 83 | + | |
| 84 | - | this.setKeks(this.pow + "!ALL",this.total + 1); |
| 84 | + | |
| 85 | - | this.setKeks(this.pow + "!miner", (this.getKeks(this.pow + "!miner") + 1)); |
| 85 | + | |
| 86 | } | |
| 87 | window.document.title = this.killstr + popupstr + '|MAP A GAME'; | |
| 88 | } | |
| 89 | Mod.prototype.getKeks = function(name){
| |
| 90 | - | if(whisper.indexOf("equally")>-1){
|
| 90 | + | |
| 91 | - | this.setKeks(this.pow+"!equal",this.getKeks(this.pow+"!equal")+1); |
| 91 | + | |
| 92 | return parseInt(parts.pop().split(";").shift());
| |
| 93 | - | this.setKeks(this.pow+"!ALL",this.total + 1); |
| 93 | + | |
| 94 | return 0; | |
| 95 | } | |
| 96 | Mod.prototype.setKeks = function(Bezeichner,Wert){
| |
| 97 | document.cookie=Bezeichner+"="+Wert+";expires=Fri, 16 Oct 2222 14:19:54 GMT;"; | |
| 98 | } | |
| 99 | Mod.prototype.terminate = function(){
| |
| 100 | _.each(this.elements, function(element){
| |
| 101 | if(_.isArray(element)){
| |
| 102 | _.each(element, function(el){ el.remove(); });
| |
| 103 | }else{
| |
| 104 | element.remove(); | |
| 105 | } | |
| 106 | }); | |
| 107 | clearInterval(this.timers.update); | |
| 108 | window.m = undefined; | |
| 109 | } | |
| 110 | // Start | |
| 111 | if(!window.m){window.m = new Mod();} |