IdlePixel Easter 2023 Tracker

Tracks which eggs have been crafted & notifies for bunny

  1. // ==UserScript==
  2. // @name IdlePixel Easter 2023 Tracker
  3. // @namespace lbtechnology.info
  4. // @version 1.1.0
  5. // @description Tracks which eggs have been crafted & notifies for bunny
  6. // @author Lux-Ferre
  7. // @license MIT
  8. // @match *://idle-pixel.com/login/play*
  9. // @grant none
  10. // @require https://gf.qytechs.cn/scripts/441206-idlepixel/code/IdlePixel+.js?anticache=20220905
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14.  
  15. let eggList = new Set()
  16. let bunnyActive = false;
  17.  
  18. const fullEggList = [
  19. "stone_egg",
  20. "copper_egg",
  21. "iron_egg",
  22. "silver_egg",
  23. "gold_egg",
  24. "bronze_metal_egg",
  25. "iron_metal_egg",
  26. "silver_metal_egg",
  27. "gold_metal_egg",
  28. "dotted_green_leaf_egg",
  29. "green_leaf_egg",
  30. "lime_leaf_egg",
  31. "gold_leaf_egg",
  32. "logs_egg",
  33. "oak_logs_egg",
  34. "willow_logs_egg",
  35. "maple_logs_egg",
  36. "chocolate_bar_egg",
  37. "apple_egg",
  38. "banana_egg",
  39. "maggot_egg",
  40. "stinger_egg",
  41. "iron_dagger_egg",
  42. ]
  43. class EasterPlugin extends IdlePixelPlusPlugin {
  44. constructor() {
  45. super("easter", {
  46. about: {
  47. name: GM_info.script.name,
  48. version: GM_info.script.version,
  49. author: GM_info.script.author,
  50. description: GM_info.script.description
  51. },
  52. });
  53. this.previous = "";
  54. }
  55.  
  56. createPanel(){
  57. IdlePixelPlus.addPanel("eastereggs", "Easter Egg List", function() {
  58. let content = "<div>";
  59. fullEggList.forEach((egg)=>{
  60. const found = eggList.has(egg)? "\u{1F7E2}" : "\u{1F534}"
  61.  
  62. content += `<p class="notification"><strong>${egg.toUpperCase().replace("_", " ")} ${found}</strong></p><br/>`
  63. })
  64. content += "</div>";
  65. return content;
  66. });
  67. }
  68.  
  69. onLogin(){
  70. const onlineCount = $(".top-bar .gold:not(#top-bar-admin-link)");
  71. onlineCount.before(`
  72. <a href="#" class="hover float-end link-no-decoration" onclick="event.preventDefault(); IdlePixelPlus.setPanel('eastereggs')" title="Open Egg List">Eggs&nbsp;&nbsp;&nbsp;</a>
  73. `);
  74. this.createPanel()
  75. }
  76. onMessageReceived(data){
  77. if(data.startsWith("SET_ITEMS=")){
  78. const split = data.substring("SET_ITEMS=".length).split("~");
  79. split.forEach(element => {
  80. if (element.endsWith("egg_crafted")){
  81. eggList.add(element.slice(0, -8))
  82. IdlePixelPlus.refreshPanel("eastereggs")
  83. console.log(eggList)
  84. }
  85. })
  86. if (typeof var_easter_bunny_timer !== 'undefined'){
  87. if (var_easter_bunny_timer > 0 && bunnyActive===false){
  88. bunnyActive = true;
  89. this.notify();
  90. }
  91. else if (var_easter_bunny_timer < 1 && bunnyActive===true){
  92. bunnyActive = false;
  93. }
  94. }
  95. }
  96. }
  97.  
  98. notify(){
  99. Sounds.play(Sounds.VARIABLE_POWER_UP)
  100. if (!window.Notification) {
  101. alert("Sorry, Notifications are not supported in this Browser!");
  102. } else {
  103. if (Notification.permission === 'default') {
  104. Notification.requestPermission(function(p) {
  105. if (p === 'denied') {
  106. alert('You have denied Notifications'); }
  107. else {
  108. var notify = new Notification('Bunny Notification', {
  109. body: `The bunny has appeared!`,
  110. requireInteraction: true,
  111. icon: bun
  112. });
  113. }
  114. });
  115. } else {
  116. var notify = new Notification('Bunny Notification', {
  117. body: `The bunny has appeared!`,
  118. requireInteraction: true,
  119. icon: bun
  120. });
  121. }
  122. }
  123. }
  124.  
  125.  
  126. }
  127. const plugin = new EasterPlugin();
  128. var bun = "https://d1xsc8x7nc5q8t.cloudfront.net/images/easter_bunny.png"
  129. IdlePixelPlus.registerPlugin(plugin);
  130. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址