Lucibear

Untitled

Sep 22nd, 2020
219
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.3
  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 switches = {"click":false,
  14.                     "hatch":false,
  15.                     "dungeon":false
  16.                    };
  17.     var i;
  18.     var auto = {"click":null,
  19.                 "hatch":null,
  20.                 "dungeon":null
  21.                };
  22.     var dungeonCoord = {"x":0,
  23.                         "y":5
  24.                        };
  25.     window.toggleClicker = function() {
  26.         if (switches.click) {
  27.             document.getElementById("autoClick").style.color = 'red';
  28.             clearInterval(auto.click);
  29.             switches.click = false;
  30.         } else if (!switches.click) {
  31.             document.getElementById("autoClick").style.color = 'black';
  32.             auto.click = setInterval(function(){
  33.                 if(App.game.gameState == 2){
  34.                     Battle.clickAttack();
  35.                 }
  36.                 else if(App.game.gameState == 3){
  37.                     GymBattle.clickAttack();
  38.                 }
  39.             },20);
  40.             switches.click = true;
  41.         }
  42.     }
  43.     function moveTile(){
  44.                     DungeonRunner.map.moveToCoordinates(dungeonCoord.x, dungeonCoord.y--);
  45.                     if(dungeonCoord.y < 0){
  46.                         dungeonCoord.x = ++dungeonCoord.x % 6;
  47.                         dungeonCoord.y = 5;
  48.                     }
  49.     }
  50.     window.toggleDungeon = function() {
  51.         if (switches.dungeon) {
  52.             document.getElementById("autoDungeon").style.color = 'red';
  53.             clearInterval(auto.dungeon);
  54.             switches.dungeon = false;
  55.         } else if (!switches.dungeon) {
  56.             document.getElementById("autoDungeon").style.color = 'black';
  57.             auto.dungeon = setInterval(function(){
  58.                 if(App.game.gameState != 4){
  59.                     dungeonCoord.x = 0;
  60.                     dungeonCoord.y = 5;
  61.                     return;
  62.                 }
  63.                 else if (DungeonRunner.map.currentTile().type() == 0){ //empty
  64.                 moveTile();
  65.                 }
  66.                 else if (DungeonRunner.map.currentTile().type() == 1){ //Enemy
  67.                     DungeonBattle.clickAttack();
  68.                     if(DungeonRunner.pokemonDefeated){
  69.                         moveTile();
  70.                     }
  71.                 }
  72.                 else if (DungeonRunner.map.currentTile().type() == 2){ //Chest
  73.                     DungeonRunner.openChest();
  74.                     moveTile();
  75.                 }
  76.                 else if (DungeonRunner.map.currentTile().type() == 3){ //Boss
  77.                     if(!DungeonRunner.fightingBoss()){
  78.                     DungeonRunner.startBossFight();
  79.                     }
  80.                     DungeonBattle.clickAttack();
  81.                 }
  82.             },20);
  83.             switches.dungeon = true;
  84.         }
  85.     }
  86.     window.toggleBreeder = function() {
  87.         if (switches.hatch) {
  88.             document.getElementById("autoHatch").style.color = 'red';
  89.             clearInterval(auto.hatch);
  90.             switches.hatch = false;
  91.         } else if (!switches.hatch) {
  92.             document.getElementById("autoHatch").style.color = 'black';
  93.             auto.hatch = setInterval(function(){
  94.                 for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  95.                     if(App.game.breeding.eggList[s]().canHatch()){
  96.                         App.game.breeding.hatchPokemonEgg(s);
  97.                     }
  98.                 }
  99.                 for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  100.                     if(!App.game.breeding.hasFreeEggSlot()){
  101.                         break;
  102.                     }
  103.                     else if(BreedingController.breedableList().length > 0){
  104.                         App.game.breeding.gainPokemonEgg(BreedingController.breedableList()[0]);
  105.                         break;
  106.                     }
  107.                 }
  108.             },200);
  109.             switches.hatch = true;
  110.         }
  111.     }
  112.     window.autoFarm = setInterval(function(){
  113.         let count = App.game.farming.unlockedPlotCount();
  114.         for(let p = 0;p < count; p++){
  115.             if(App.game.farming.plotList[p].timeLeft <= 0 && App.game.farming.plotList[p].isUnlocked){
  116.                 App.game.farming.harvest(p,true);
  117.                 App.game.farming.plant(p,FarmController.selectedBerry);
  118.             }
  119.         }},500);
  120.     document.querySelector("div.col.no-gutters.clickable").parentNode.parentNode.parentNode.innerHTML += ('<button id="autoClick" style="color:red" onclick="toggleClicker()">AutoClick</button>');
  121.     document.querySelector("#breedingDisplay").innerHTML += ('<button id="autoHatch" style="color:red" onclick="toggleBreeder()">AutoHatch</button>');
  122.     document.querySelector("#townMap").innerHTML += ('<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>');
  123. })();
Advertisement
Add Comment
Please, Sign In to add comment