Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- A MAP GAME Mod by Rebin
- javascript:var s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='//pastebin.com/raw.php?i=NgvJm66K';void(0);
- */
- 'use strict';
- function Mod(){
- $('<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js">').appendTo('body')
- jQuery.fn.outerHTML = function(s) { return s ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); };
- this.pow = this.getKeks("#lastPow");
- this.total = this.getKeks(this.pow +"!ALL");
- this.limit = this.getKeks("#limit");
- this.oldmists = -1;
- window.document.title='|MAP A GAME';
- this.initTimer = setInterval(function(){ this.checkInit(); }.bind(this), 20);
- }
- Mod.prototype.checkInit = function(){
- if(typeof(game) != "undefined"){
- if(game.loaded){
- clearInterval(this.initTimer);
- this.init();
- }
- }
- }
- Mod.prototype.init = function(){
- this.maxpow = 34;
- while(this.total >= this.limit){
- if(this.pow == this.maxpow){
- if(this.limit == 1000){
- this.killstr = ">>>";
- clearInterval(this.timers.update);
- this.update();
- } else {
- this.pow = 27;
- this.setKeks("#lastPow",27);
- this.total = this.getKeks("27!ALL");
- this.limit += 100;
- this.setKeks("#limit",this.limit);
- }
- } else {
- this.pow++;
- this.setKeks("#lastPow",this.pow);
- this.total = this.getKeks(this.pow+"!ALL");
- }
- }
- this.killstr = this.pow;
- //this.adv_ninjapow = 11;
- this.adv_sac = Math.ceil(Math.pow(10,11)*Math.pow(Math.E,this.pow)/5000).toLocaleString().replace(/\./g,"");
- // TIMERS
- this.timers = {
- update: false,
- };
- // Updater
- this.timers.update = setInterval(function(){ this.update(); }.bind(this), 42);
- // Elements
- }
- Mod.prototype.update = function(){
- if("undefined" === typeof _) return;
- var popupstr = "";
- if(this.killstr != ">>>"){
- if($('div[id="popup"]:visible').length==1){
- var popupHTML = $('div[id="popup"]')[0].innerHTML;
- if(popupHTML.indexOf("What will you offer")>-1){
- if(this.oldmists < 0){
- this.oldmists = game.villages[game.currentVillage].employed.adv_miner[0];
- }
- if($('input[id="advArmy-templar"]')[0].value!=this.adv_sac){
- $('input[id="advArmy-templar"]')[0].value = this.adv_sac;
- } else {
- popupstr = "#";
- }
- } else if(popupHTML.indexOf("Do you want to offer some of your troops")>-1){
- popupstr = "+"
- } else if(popupHTML.indexOf("A whisper is heard: ")>-1){
- var whisper = $('div[name="content"]')[0].innerHTML.slice(20,666)
- var result = this.pow + whisper;
- if (whisper.indexOf("built upon our efforts")>-1){
- var newmists = game.villages[game.currentVillage].employed.adv_miner[0] - this.oldmists;
- if(newmists > 0){
- this.setKeks(this.pow+"!miners"+newmists,this.getKeks(this.pow+"!miners"+newmists)+1);
- this.setKeks(this.pow + "!ALL",this.total + 1);
- this.setKeks(this.pow + "!miner", (this.getKeks(this.pow + "!miner") + 1));
- clearInterval(this.timers.update);
- location.reload();
- }
- } else {
- if(whisper.indexOf("equally")>-1){
- this.setKeks(this.pow+"!equal",this.getKeks(this.pow+"!equal")+1);
- }
- this.setKeks(this.pow+"!ALL",this.total + 1);
- clearInterval(this.timers.update);
- location.reload();
- }
- }
- }
- }
- window.document.title = this.killstr + popupstr + '|MAP A GAME';
- }
- Mod.prototype.getKeks = function(name){
- var parts = document.cookie.split(" " + name + "=");
- if(parts.length == 2){
- return parseInt(parts.pop().split(";").shift());
- }
- return 0;
- }
- Mod.prototype.setKeks = function(Bezeichner,Wert){
- document.cookie=Bezeichner+"="+Wert+";expires=Fri, 16 Oct 2222 14:19:54 GMT;";
- }
- Mod.prototype.terminate = function(){
- _.each(this.elements, function(element){
- if(_.isArray(element)){
- _.each(element, function(el){ el.remove(); });
- }else{
- element.remove();
- }
- });
- clearInterval(this.timers.update);
- window.m = undefined;
- }
- // Start
- if(!window.m){window.m = new Mod();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement