Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Pokeclicker
- // @namespace http://tampermonkey.net/
- // @version 0.4
- // @description try to take over the world!
- // @author You
- // @match https://www.pokeclicker.com/
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var switches = {"click":false,
- "hatch":false,
- "dungeon":false,
- "gym":false,
- "repDungeon":false
- };
- var i;
- var auto = {"click":null,
- "hatch":null,
- "dungeon":null,
- "gym":null
- };
- var dungeonCoord = {"x":0,
- "y":5
- };
- window.toggleClicker = function() {
- if (switches.click) {
- document.getElementById("autoClick").style.color = 'red';
- clearInterval(auto.click);
- switches.click = false;
- } else if (!switches.click) {
- document.getElementById("autoClick").style.color = 'black';
- auto.click = setInterval(function(){
- if(App.game.gameState == 2){
- Battle.clickAttack();
- }
- else if(App.game.gameState == 3){
- GymBattle.clickAttack();
- }
- },20);
- switches.click = true;
- }
- }
- function moveTile(){
- DungeonRunner.map.moveToCoordinates(dungeonCoord.x, dungeonCoord.y--);
- if(dungeonCoord.y < 0){
- dungeonCoord.x = ++dungeonCoord.x % 6;
- dungeonCoord.y = 5;
- }
- }
- window.toggleGym = function() {
- if (switches.gym) {
- document.getElementById("autoGym").style.color = 'red';
- clearInterval(auto.gym);
- switches.gym = false;
- } else if (!switches.gym) {
- document.getElementById("autoGym").style.color = 'black';
- auto.gym = setInterval(function(){
- if(App.game.gameState == 6 && player.town().gym()){
- GymRunner.startGym(player.town().gym());
- }
- },20);
- switches.gym = true;
- }
- }
- window.toggleRepDungeon = function() {
- if (switches.repDungeon) {
- document.getElementById("repDungeon").style.color = 'red';
- switches.repDungeon = false;
- } else if (!switches.gym) {
- document.getElementById("repDungeon").style.color = 'black';
- switches.repDungeon = true;
- }
- }
- window.toggleDungeon = function() {
- if (switches.dungeon) {
- document.getElementById("autoDungeon").style.color = 'red';
- clearInterval(auto.dungeon);
- switches.dungeon = false;
- } else if (!switches.dungeon) {
- document.getElementById("autoDungeon").style.color = 'black';
- auto.dungeon = setInterval(function(){
- if(switches.repDungeon && App.game.gameState == 6 && player.town().dungeon()){
- DungeonRunner.dungeon = player.town().dungeon();
- if(DungeonRunner.hasEnoughTokens()){
- DungeonRunner.initializeDungeon(player.town().dungeon());
- }
- }
- else if(App.game.gameState != 4){
- dungeonCoord.x = 0;
- dungeonCoord.y = 5;
- return;
- }
- else if (DungeonRunner.map.currentTile().type() == 0){ //empty
- moveTile();
- }
- else if (DungeonRunner.map.currentTile().type() == 1){ //Enemy
- DungeonBattle.clickAttack();
- if(DungeonRunner.pokemonDefeated){
- moveTile();
- }
- }
- else if (DungeonRunner.map.currentTile().type() == 2){ //Chest
- DungeonRunner.openChest();
- moveTile();
- }
- else if (DungeonRunner.map.currentTile().type() == 3){ //Boss
- if(!DungeonRunner.fightingBoss()){
- DungeonRunner.startBossFight();
- }
- DungeonBattle.clickAttack();
- }
- },20);
- switches.dungeon = true;
- }
- }
- window.toggleBreeder = function() {
- if (switches.hatch) {
- document.getElementById("autoHatch").style.color = 'red';
- clearInterval(auto.hatch);
- switches.hatch = false;
- } else if (!switches.hatch) {
- document.getElementById("autoHatch").style.color = 'black';
- auto.hatch = setInterval(function(){
- for(let s = 0; s < App.game.breeding.eggSlots; s ++){
- if(App.game.breeding.eggList[s]().canHatch()){
- App.game.breeding.hatchPokemonEgg(s);
- }
- }
- for(let s = 0; s < App.game.breeding.eggSlots; s ++){
- if(!App.game.breeding.hasFreeEggSlot()){
- break;
- }
- else if(BreedingController.breedableList().length > 0){
- App.game.breeding.gainPokemonEgg(BreedingController.breedableList()[0]);
- break;
- }
- }
- },200);
- switches.hatch = true;
- }
- }
- window.autoFarm = setInterval(function(){
- let count = App.game.farming.unlockedPlotCount();
- for(let p = 0;p < count; p++){
- if(App.game.farming.plotList[p].timeLeft <= 0 && App.game.farming.plotList[p].isUnlocked){
- App.game.farming.harvest(p,true);
- App.game.farming.plant(p,FarmController.selectedBerry);
- }
- }},500);
- window.autoMine = setInterval(function(){
- if(Underground.energy > 10){
- Mine.bomb(10)
- }
- },500);
- document.querySelector("div.col.no-gutters.clickable").parentNode.parentNode.parentNode.innerHTML += ('<button id="autoClick" style="color:red" onclick="toggleClicker()">AutoClick</button>');
- document.querySelector("#breedingDisplay").innerHTML += ('<button id="autoHatch" style="color:red" onclick="toggleBreeder()">AutoHatch</button>');
- var centerbuttons = '<div id="centerbuttons" class="row" margin:"auto">' +
- '<button id="repDungeon" style="color:red" onclick="toggleRepDungeon()">Repeat Dungeon</button>' +
- '<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>' +
- '<button id="autoGym" style="color:red" onclick="toggleGym()">AutoGym</button>' +
- '</div>';
- document.querySelector("#middle-column").innerHTML += centerbuttons;
- // document.querySelector("#middle-column").innerHTML += ('<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>');
- // document.querySelector("#middle-column").innerHTML += ('<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>');
- })();
Advertisement
Add Comment
Please, Sign In to add comment