Lucibear

Untitled

Sep 22nd, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.59 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Pokeclicker
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  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. "gym":false,
  17. "repDungeon":false,
  18. "bomb":true,
  19. "speedBall":false
  20. };
  21. var i;
  22. var auto = {"click":null,
  23. "hatch":null,
  24. "dungeon":null,
  25. "gym":null
  26. };
  27. var dungeonCoord = {"x":0,
  28. "y":5
  29. };
  30. window.toggleClicker = function() {
  31. if (switches.click) {
  32. document.getElementById("autoClick").style.color = 'red';
  33. clearInterval(auto.click);
  34. switches.click = false;
  35. } else if (!switches.click) {
  36. document.getElementById("autoClick").style.color = 'black';
  37. auto.click = setInterval(function(){
  38. if(App.game.gameState == 2){
  39. Battle.clickAttack();
  40. }
  41. else if(App.game.gameState == 3){
  42. GymBattle.clickAttack();
  43. }
  44. },10);
  45. switches.click = true;
  46. }
  47. }
  48. window.toggleSpeedBall = function(){
  49. if (switches.speedBall) {
  50. document.getElementById("speedBall").style.color = 'red';
  51. switches.speedBall = false;
  52. App.game.pokeballs.pokeballCatchTime = [1250, 1000, 750, 500];
  53. } else if (!switches.speedBall) {
  54. document.getElementById("speedBall").style.color = 'black';
  55. switches.speedBall = true;
  56. App.game.pokeballs.pokeballCatchTime = [125, 100, 75, 50]
  57. }
  58. }
  59. function moveTile(){
  60. if(DungeonBattle.catching()){
  61. return;
  62. }
  63. //dungeonCoord = DungeonRunner.map.playerPosition();
  64.  
  65. console.log("moving to " + dungeonCoord.x + "," + dungeonCoord.y);
  66. DungeonRunner.map.moveToCoordinates(dungeonCoord.x, dungeonCoord.y);
  67. if(dungeonCoord.y <= 0){
  68. dungeonCoord.x = ++dungeonCoord.x % DungeonRunner.map.size;
  69. dungeonCoord.y = DungeonRunner.map.size-1;
  70. }
  71. else{
  72. dungeonCoord.y--;
  73. }
  74. }
  75. window.toggleGym = function() {
  76. if (switches.gym) {
  77. document.getElementById("autoGym").style.color = 'red';
  78. clearInterval(auto.gym);
  79. switches.gym = false;
  80. } else if (!switches.gym) {
  81. document.getElementById("autoGym").style.color = 'black';
  82. auto.gym = setInterval(function(){
  83. if(App.game.gameState == 6 && player.town().gym()){
  84. GymRunner.startGym(player.town().gym());
  85. }
  86. },20);
  87. switches.gym = true;
  88. }
  89. }
  90. window.toggleBomb = function() {
  91. if (switches.bomb) {
  92. document.getElementById("autoBomb").style.color = 'red';
  93. switches.bomb = false;
  94. } else if (!switches.bomb) {
  95. document.getElementById("autoBomb").style.color = 'black';
  96. switches.bomb = true;
  97. }
  98. }
  99. window.toggleRepDungeon = function() {
  100. if (switches.repDungeon) {
  101. document.getElementById("repDungeon").style.color = 'red';
  102. switches.repDungeon = false;
  103. } else if (!switches.gym) {
  104. document.getElementById("repDungeon").style.color = 'black';
  105. switches.repDungeon = true;
  106. }
  107. }
  108. window.toggleDungeon = function() {
  109. if (switches.dungeon) {
  110. document.getElementById("autoDungeon").style.color = 'red';
  111. clearInterval(auto.dungeon);
  112. switches.dungeon = false;
  113. } else if (!switches.dungeon) {
  114. document.getElementById("autoDungeon").style.color = 'black';
  115. auto.dungeon = setInterval(function(){
  116. if(switches.repDungeon && App.game.gameState == 6 && player.town().dungeon()){
  117. DungeonRunner.dungeon = player.town().dungeon();
  118. if(DungeonRunner.hasEnoughTokens()){
  119. DungeonRunner.initializeDungeon(player.town().dungeon());
  120. dungeonCoord = {x:0,y:DungeonRunner.map.size-1};
  121. // dungeonCoord.x = Math.floor(DungeonRunner.map.size/2);
  122. // dungeonCoord.y = DungeonRunner.map.size-1;
  123. }
  124. }
  125.  
  126. else if(App.game.gameState != 4){
  127. // dungeonCoord.x = Math.floor(DungeonRunner.map.size/2);
  128. // dungeonCoord.y = DungeonRunner.map.size-1;
  129. return;
  130. }
  131. else if (DungeonRunner.map.currentTile().type() == 0){ //empty
  132. moveTile();
  133. }
  134. else if (DungeonRunner.map.currentTile().type() == 1){ //Enemy
  135. DungeonBattle.clickAttack();
  136. if(DungeonRunner.pokemonDefeated){
  137. moveTile();
  138. }
  139. }
  140. else if (DungeonRunner.map.currentTile().type() == 2){ //Chest
  141. DungeonRunner.openChest();
  142. moveTile();
  143. }
  144. else if (DungeonRunner.map.currentTile().type() == 3){ //Boss
  145. if(!DungeonRunner.fightingBoss()){
  146. DungeonRunner.startBossFight();
  147. dungeonCoord = {x:0,y:DungeonRunner.map.size-1};
  148. }
  149. DungeonBattle.clickAttack();
  150. }
  151. },10);
  152. switches.dungeon = true;
  153. }
  154. }
  155. var egglist = ["Dragon_egg",
  156. "Electric_egg",
  157. "Fighting_egg",
  158. "Fire_egg",
  159. "Grass_egg",
  160. "Mystery_egg",
  161. "Water_egg"
  162. ]
  163. window.toggleBreeder = function() {
  164. if (switches.hatch) {
  165. document.getElementById("autoHatch").style.color = 'red';
  166. clearInterval(auto.hatch);
  167. switches.hatch = false;
  168. } else if (!switches.hatch) {
  169. document.getElementById("autoHatch").style.color = 'black';
  170. auto.hatch = setInterval(function(){
  171. for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  172. if(App.game.breeding.eggList[s]().canHatch()){
  173. App.game.breeding.hatchPokemonEgg(s);
  174. }
  175. }
  176. for(let s = 0; s < App.game.breeding.eggSlots; s ++){
  177. if(!App.game.breeding.hasFreeEggSlot()){
  178. break;
  179. }
  180. else{
  181. for(let egg of egglist){
  182. if(player.itemList[egg]() > 0 && !ItemList[egg].getCaughtStatus()){
  183. ItemHandler.useItem(egg);
  184. break;
  185. }
  186. }
  187. if(BreedingController.breedableList().length > 0 && App.game.breeding.hasFreeEggSlot()){
  188. App.game.breeding.gainPokemonEgg(BreedingController.breedableList()[0]);
  189. break;
  190. }
  191. }
  192. }
  193. },200);
  194. switches.hatch = true;
  195. }
  196. }
  197. window.autoFarm = setInterval(function(){
  198. let count = App.game.farming.unlockedPlotCount();
  199. for(let p = 0;p < count; p++){
  200. if(App.game.farming.plotList[p].timeLeft <= 0 && App.game.farming.plotList[p].isUnlocked){
  201. App.game.farming.harvest(p,true);
  202. App.game.farming.plant(p,FarmController.selectedBerry);
  203. }
  204. }},500);
  205. window.autoMine = setInterval(function(){
  206. if(switches.bomb && Underground.energy >= 10){
  207. Mine.bomb(10)
  208. }
  209. },500);
  210. document.querySelector("div.col.no-gutters.clickable").parentNode.parentNode.parentNode.innerHTML += ('<button id="autoClick" style="color:red" onclick="toggleClicker()">AutoClick</button>');
  211. document.querySelector("#breedingDisplay").innerHTML += ('<button id="autoHatch" style="color:red" onclick="toggleBreeder()">AutoHatch</button>');
  212. var centerbuttons = '<div id="centerbuttons" class="row" margin:"auto">' +
  213. '<button id="repDungeon" style="color:red" onclick="toggleRepDungeon()">Repeat Dungeon</button>' +
  214. '<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>' +
  215. '<button id="autoGym" style="color:red" onclick="toggleGym()">AutoGym</button>' +
  216. '<button id="autoBomb" style="color:black" onclick="toggleBomb()">Auto Nuke the Caves</button>' +
  217. '<button id="speedBall" style="color:red" onclick="toggleSpeedBall()">SpeedBall(cheaty)</button>' +
  218. '</div>';
  219. document.querySelector("#middle-column").innerHTML += centerbuttons;
  220. // document.querySelector("#middle-column").innerHTML += ('<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>');
  221. // document.querySelector("#middle-column").innerHTML += ('<button id="autoDungeon" style="color:red" onclick="toggleDungeon()">AutoDungeon</button>');
  222. })();
Advertisement
Add Comment
Please, Sign In to add comment