Advertisement
Golosomie

datmod RWARWRAR

Apr 5th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     window.document.title='|MIAU A GAME';
  12.     this.initTimer = setInterval(function(){ this.checkInit(); }.bind(this), 20);
  13. }
  14.  
  15. Mod.prototype.checkInit = function(){
  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(game.adventure.stage == 0){
  37.         this.setKeks("result#",this.getKeks("result#")+1);
  38.         this.setKeks("result"+game.adventure.reward,this.getKeks("result"+game.adventure.reward)+1);  
  39.         clearInterval(this.timers.update);
  40.         location.reload();
  41.     }
  42. }
  43. Mod.prototype.getKeks = function(name){
  44.     var parts = document.cookie.split(" " + name + "=");
  45.     if(parts.length == 2){
  46.         return parseInt(parts.pop().split(";").shift());
  47.     }
  48.     return 0;
  49. }
  50. Mod.prototype.setKeks = function(Bezeichner,Wert){
  51.     document.cookie=Bezeichner+"="+Wert+";expires=Fri, 16 Oct 2222 14:19:54 GMT;";
  52. }
  53. Mod.prototype.terminate = function(){
  54.         _.each(this.elements, function(element){
  55.                 if(_.isArray(element)){
  56.                         _.each(element, function(el){ el.remove(); });
  57.                 }else{
  58.                         element.remove();
  59.                 }
  60.         });
  61.         clearInterval(this.timers.update);
  62.         window.m = undefined;
  63. }
  64. // Start
  65. if(!window.m){window.m = new Mod();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement