// ==UserScript== // @name [Pokeclicker] Catch Speed Adjuster // @namespace Pokeclicker Scripts // @author Ephenia // @description Adjusts catch speed of all Pokeballs. Currently only makes Pokeballs catch as fast as possible. // @copyright https://github.com/Ephenia // @license GPL-3.0 License // @version 1.4 // @homepageURL https://github.com/Ephenia/Pokeclicker-Scripts/ // @supportURL https://github.com/Ephenia/Pokeclicker-Scripts/issues // @match https://www.pokeclicker.com/ // @icon https://www.google.com/s2/favicons?domain=pokeclicker.com // @grant none // @run-at document-idle // @downloadURL none // ==/UserScript== var scriptName = 'catchspeedadjuster'; var ballAdjuster; var defaultTime = []; function initBallAdjust() { var getBalls = App.game.pokeballs.pokeballs; for (var i = 0; i < getBalls.length; i++) { defaultTime.push(getBalls[i].catchTime) } var ballCont = document.getElementById('pokeballFilters'); var ballAdj = document.createElement("tr"); ballAdj.innerHTML = `
` ballCont.append(ballAdj) document.getElementById('ball-adjust').addEventListener('click', event => changeAdjust(event.target)); if (ballAdjuster) { document.getElementById('ball-adjust').checked = true; catchDelay(); } function changeAdjust(ele) { ballAdjuster = !ballAdjuster; localStorage.setItem("ballAdjuster", ballAdjuster); catchDelay(); } function catchDelay() { for (var i = 0; i < getBalls.length; i++) { if (ballAdjuster) { getBalls[i].catchTime = 0; } else { getBalls[i].catchTime = defaultTime[i]; } } } } if (localStorage.getItem('ballAdjuster') == null) { localStorage.setItem('ballAdjuster', 'false'); } ballAdjuster = localStorage.getItem('ballAdjuster') == 'true'; function loadScript() { const oldInit = Preload.hideSplashScreen; var hasInitialized = false; Preload.hideSplashScreen = function (...args) { var result = oldInit.apply(this, args); if (App.game && !hasInitialized) { initBallAdjust(); hasInitialized = true; } return result; } } if (!App.isUsingClient || localStorage.getItem(scriptName) === 'true') { loadScript(); }