IdlePixel Slap Chop Select Monster Addon

Slap Chop select monster addon

  1. // ==UserScript==
  2. // @name IdlePixel Slap Chop Select Monster Addon
  3. // @version 1.1.0
  4. // @description Slap Chop select monster addon
  5. // @author Dounford
  6. // @license MIT
  7. // @match *://idle-pixel.com/login/play*
  8. // @grant none
  9. // @require https://greasyfork.org/scripts/441206-idlepixel/code/IdlePixel+.js
  10. // @namespace https://greasyfork.org/users/1175326
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. class SelectMonsterPlugin extends IdlePixelPlusPlugin {
  17. constructor() {
  18. super("selectMonster", {
  19. about: {
  20. name: GM_info.script.name,
  21. version: GM_info.script.version,
  22. author: GM_info.script.author,
  23. description: GM_info.script.description
  24. },
  25. });
  26. }
  27.  
  28. onLogin() {
  29. IdlePixelPlus.plugins.selectMonster.tryInit();
  30. }
  31.  
  32. init() {
  33. Object.values(IdlePixelPlus.info.combatZones).forEach((zone) => {
  34. document.querySelector(`#slapchop-quickfight-${zone.id} button`).setAttribute('onclick',`Globals.last_area_fight='${zone.id}';sCCombat().quickFight('${zone.id}')`)
  35. })
  36. console.log('Slap Chop Addon initiated')
  37. }
  38.  
  39. tryInit() {
  40. if (document.getElementById('slapchop-quickfight')) {
  41. IdlePixelPlus.plugins.selectMonster.init();
  42. } else {
  43. setTimeout(function(){IdlePixelPlus.plugins.selectMonster.tryInit()},5000)
  44. console.log('Slap Chop not found')
  45. }
  46. }
  47. }
  48.  
  49. const plugin = new SelectMonsterPlugin();
  50. IdlePixelPlus.registerPlugin(plugin);
  51.  
  52. })();