Lucibear

Untitled

Sep 22nd, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Pokeclicker
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.pokeclicker.com/
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.     var toggleClick = false;
  14.     var toggleHatch = false;
  15.     var i;
  16.     var autoEgg;
  17.     window.toggleClicker = function() {
  18.         if (toggleClick) {
  19.             document.getElementById("autoClick").style.color = 'red';
  20.             clearInterval(i);
  21.             toggleClick = false;
  22.         } else if (!toggleClick) {
  23.             document.getElementById("autoClick").style.color = 'black';
  24.             i = setInterval(function(){
  25.                 if(App.game.gameState == 2){
  26.                     Battle.clickAttack();
  27.                 }
  28.                 else if(App.game.gameState == 3){
  29.                     GymBattle.clickAttack();
  30.                 }
  31.                 else if(App.game.gameState == 4){
  32.                     DungeonBattle.clickAttack();
  33.                     DungeonRunner.openChest();
  34.                     DungeonRunner.startBossFight();
  35.                 }
  36.             },20);
  37.             toggleClick = true;
  38.         }
  39.     }
  40.     window.toggleBreeder = function() {
  41.         if (toggleHatch) {
  42.             document.getElementById("autoHatch").style.color = 'red';
  43.             clearInterval(autoEgg);
  44.             toggleHatch = false;
  45.         } else if (!toggleHatch) {
  46.             document.getElementById("autoHatch").style.color = 'black';
  47.             autoEgg = setInterval(function(){
  48.                 for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  49.                     if(App.game.breeding.eggList[s]().canHatch()){
  50.                         App.game.breeding.hatchPokemonEgg(s);
  51.                     }
  52.                 }
  53.                 for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  54.                     if(!App.game.breeding.hasFreeEggSlot()){
  55.                         break;
  56.                     }
  57.                     else if(BreedingController.breedableList().length > 0){
  58.                         App.game.breeding.gainPokemonEgg(BreedingController.breedableList()[0]);
  59.                         break;
  60.                     }
  61.                 }
  62.             },200);
  63.             toggleHatch = true;
  64.         }
  65.     }
  66.     window.autoFarm = setInterval(function(){
  67.         let count = App.game.farming.unlockedPlotCount();
  68.         for(let p = 0;p < count; p++){
  69.             if(App.game.farming.plotList[p].timeLeft <= 0 && App.game.farming.plotList[p].isUnlocked){
  70.                 App.game.farming.harvest(p,true);
  71.                 App.game.farming.plant(p,FarmController.selectedBerry);
  72.             }
  73.         }},500);
  74.     document.querySelector("div.col.no-gutters.clickable").parentNode.parentNode.parentNode.innerHTML += ('<button id="autoClick" style="color:red" onclick="toggleClicker()">AutoClick</button>');
  75.     document.querySelector("#breedingDisplay").innerHTML += ('<button id="autoHatch" style="color:red" onclick="toggleBreeder()">AutoHatch</button>');
  76. })();
Advertisement
Add Comment
Please, Sign In to add comment