PokeClicker Hacks

tab hack menu shiny rate and more...

  1. // ==UserScript==
  2. // @name PokeClicker Hacks
  3. // @author fiammanda
  4. // @version 1.20220222
  5. // @grant none
  6. // @match https://www.pokeclicker.com/
  7. // @license MIT
  8. // @description tab hack menu shiny rate and more...
  9. // @namespace https://greasyfork.org/users/1055144
  10. // ==/UserScript==
  11.  
  12. let click = 0, hatch = 0;
  13. const hacks = [
  14. [0, "catch rate", 10],
  15. ["shiny", "shiny chance", 100],
  16. ["roaming", "roaming chance", 10],
  17. ["exp", "experience", 10],
  18. ["eggStep", "egg step", 10],
  19. ["money", "money", 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999],
  20. ["dungeonToken", "dungeon token", 500000],
  21. ["clickAttack", "player attack", 9000000000],
  22. ["pokemonAttack", "pokemon attack", 100],
  23. [4, "berry growth", 100],
  24. [8, "berry mutation", 100],
  25. [9, "berry replant", 100],
  26. [7, "mine enery", 900000],
  27. [10, "mine damage", 900000],
  28. [11, "mine award", 900000]
  29. ]
  30.  
  31. const style = document.createElement("style");
  32. style.innerHTML = `
  33. #game {
  34. max-width: 1500px;
  35. }
  36. #game .col-lg-3 {
  37. flex: 0 0 20%;
  38. max-width: 20%;
  39. }
  40. #game .col-lg-6 {
  41. flex: 0 0 40%;
  42. max-width: 40%;
  43. }
  44. #hack {
  45. font-size: .825rem;
  46. overflow: auto;
  47. }
  48. #hack img, #hack svg {
  49. width: 1rem;
  50. color: #222;
  51. }
  52. #hack table {
  53. table-layout:fixed;
  54. }
  55. #hack td {
  56. padding: .25rem 0;
  57. }
  58. #hack td.disabled {
  59. background: rgba(0,0,0,.03);
  60. pointer-events: none;
  61. }
  62. #hack td.disabled img, #hack td.disabled svg {
  63. opacity: .25;
  64. }
  65. #hack td:first-child {
  66. padding: .25rem;
  67. text-align: left;
  68. }
  69. #hack td[data-rate]::before {
  70. content: attr(data-rate) attr(data-multiplier);
  71. font-size: .75rem;
  72. white-space: nowrap;
  73. }
  74. #hack td[data-rate="0"]::before {
  75. content: "-";
  76. }
  77. #hack td[onclick] {
  78. width: 2rem;
  79. background: rgba(0,0,0,.05);
  80. transition: background .2s ease-in-out;
  81. cursor: pointer;
  82. }
  83. #hack td[onclick]:hover {
  84. background: rgba(0,0,0,.08);
  85. }
  86. `;
  87. document.body.append(style);
  88.  
  89. const hack = document.createElement("div");
  90. hack.className = "col-lg-2 order-lg-first";
  91. let html = `<div class="card border-secondary mb-3">
  92. <div class="card-header p-0" data-toggle="collapse" href="#hack" aria-expanded="true"><span>Hacks</span></div>
  93. <div id="hack" class="card-body show p-0">
  94. <table class="table table-bordered m-0">
  95. <tr>
  96. <td>catch time</td>
  97. <td onclick="this.classList.add('disabled');App.game.pokeballs.pokeballs[0].catchTime = 100"><img src="assets/images/pokeball/Pokeball.svg"></td>
  98. <td onclick="this.classList.add('disabled');App.game.pokeballs.pokeballs[1].catchTime = 100"><img src="assets/images/pokeball/Greatball.svg"></td>
  99. <td onclick="this.classList.add('disabled');App.game.pokeballs.pokeballs[2].catchTime = 100"><img src="assets/images/pokeball/Ultraball.svg"></td>
  100. <td onclick="this.classList.add('disabled');App.game.pokeballs.pokeballs[3].catchTime = 100"><img src="assets/images/pokeball/Masterball.svg"></td>
  101. </tr>
  102. `;
  103. hacks.forEach((h, i) => {
  104. html += `<tr><td colspan="2">${h[1]}</td><td data-multiplier="${h[2].toString().substring(1)}" data-rate="0"></td><td onclick="`;
  105. html += `let r = Number(this.previousSibling.dataset.rate) + 1;`;
  106. html += `this.previousSibling.dataset.rate = r;`;
  107. html += `this.nextSibling.classList.remove('disabled');`;
  108. if (i == 0 || i > 8) {
  109. html += `r = r * ${h[2]};`;
  110. html += `App.game.oakItems.itemList[${h[0]}].bonusList = [r,r,r,r,r,r];`;
  111. html += `App.game.oakItems.itemList[${h[0]}].inactiveBonus = r;`;
  112. } else {
  113. html += `r = r * ${h[2]} / Math.max((r - 1) * ${h[2]}, 1);`;
  114. html += `App.game.multiplier.addBonus('${h[0]}', () => r);`;
  115. }
  116. html += `"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 5.75V18.25"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.25 12L5.75 12"/></svg></td><td class="disabled" onclick="`;
  117. if (i == 0 || i > 8) {
  118. html += `App.game.oakItems.itemList[${h[0]}].bonusList = [10,10,10,10,10,10];`;
  119. html += `App.game.oakItems.itemList[${h[0]}].inactiveBonus = 10;`;
  120. } else {
  121. html += `let r = Number(this.previousSibling.previousSibling.dataset.rate);`;
  122. html += `App.game.multiplier.addBonus('${h[0]}', () => 1 / Math.max(r * ${h[2]}, 1));`;
  123. }
  124. html += `this.previousSibling.previousSibling.dataset.rate = 0;`;
  125. html += `this.classList.add('disabled');`;
  126. html += `"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11.25 4.75L8.75 7L11.25 9.25"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12.75 19.25L15.25 17L12.75 14.75"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.75 7H13.25C16.5637 7 19.25 9.68629 19.25 13V13.25"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.25 17H10.75C7.43629 17 4.75 14.3137 4.75 11V10.75"/></svg></td></tr>`;
  127. });
  128. html += `
  129. <tr>
  130. <td colspan="3">auto click</td>
  131. <td onclick="this.classList.add('disabled');this.nextElementSibling.classList.remove('disabled');click=setInterval(()=>{4==App.game.gameState&&DungeonRunner.handleClick()},100)"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.25 12L5.75 5.75V18.25L18.25 12Z"/></svg></td>
  132. <td class="disabled" onclick="this.classList.add('disabled');this.previousElementSibling.classList.remove('disabled');clearInterval(click)"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.25 6.75V17.25"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.75 6.75V17.25"/></svg></td>
  133. <tr>
  134. </tr>
  135. <td colspan="3">auto hatch</td>
  136. <td onclick="this.classList.add('disabled');this.nextElementSibling.classList.remove('disabled');hatch=setInterval(function(){for(let a=App.game.party.caughtPokemon.filter(a=>!(a.breeding||100>a.level)&&!(-1<BreedingController.filter.category()&&a.category!=BreedingController.filter.category())&&!(-1<BreedingController.filter.shinyStatus()&&+a.shiny!==BreedingController.filter.shinyStatus()));App.game.breeding.hasFreeQueueSlot()&&a.length;)App.game.breeding.addPokemonToHatchery(a[0]),a.shift()},6e4)"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.25 12L5.75 5.75V18.25L18.25 12Z"/></svg></td>
  137. <td class="disabled" onclick="this.classList.add('disabled');this.previousElementSibling.classList.remove('disabled');clearInterval(hatch)"><svg fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.25 6.75V17.25"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.75 6.75V17.25"/></svg></td>
  138. </tr>
  139. </table>
  140. </div>
  141. </div>`;
  142. html += `<div class="card sortable border-secondary mb-3" data-bind="visible: player.highestRegion">${document.getElementById("shortcutsContainer").innerHTML}</div>`;
  143. hack.innerHTML = html;
  144. document.getElementById("shortcutsContainer").remove();
  145. document.querySelector(".justify-content-lg-center").prepend(hack);