From 47f15d63da49cdc293a43bf7e76afb5320e25f29 Mon Sep 17 00:00:00 2001 From: EasyGoinGaming Date: Wed, 5 Mar 2025 13:07:30 -0700 Subject: [PATCH 1/3] Create DreamOrbGenerator Provides a method of obtaining Dream Orbs without exiting the game, at the standard rate of 1/hour. Has not been flushed out to ensure requirements are met - advised to add *after* gaining access to Dream Orbs. --- EGGEditsorAdds/DreamOrbGenerator | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 EGGEditsorAdds/DreamOrbGenerator diff --git a/EGGEditsorAdds/DreamOrbGenerator b/EGGEditsorAdds/DreamOrbGenerator new file mode 100644 index 0000000..3c99b3d --- /dev/null +++ b/EGGEditsorAdds/DreamOrbGenerator @@ -0,0 +1,54 @@ +// ==UserScript== +// @name Dream Orb Online Collector +// @description Grants 1 random Dream Orb every hour while playing online. +// @version 2.0 +// @author Your Name +// @match *://www.pokeclicker.com/* +// ==/UserScript== + +(function() { + const ONE_HOUR = 60 * 60 * 1000; + + // Load the last saved orb time from localStorage (persist across refreshes) + window.lastOrbTime = Number(localStorage.getItem('dreamOrbOnline_lastOrbTime')) || Date.now(); + + /** + * Awards a random Dream Orb to the player. + */ + window.awardDreamOrb = function() { + const colors = ['Pink', 'Green', 'Orange', 'Blue']; + const chosenColor = Rand.fromArray(colors); + + const orb = App.game.dreamOrbController.orbs.find(o => o.color === chosenColor); + if (orb) { + orb.amount(orb.amount() + 1); + + Notifier.notify({ + message: `You received a ${chosenColor} Dream Orb!`, + type: NotificationConstants.NotificationOption.success, + }); + + console.log(`[DreamOrbOnline] Awarded: ${chosenColor} Dream Orb`); + } else { + console.error(`[DreamOrbOnline] Could not find Dream Orb of color: ${chosenColor}`); + } + + window.lastOrbTime = Date.now(); + localStorage.setItem('dreamOrbOnline_lastOrbTime', String(window.lastOrbTime)); + }; + + /** + * Checks if it's time to award a Dream Orb, and awards one if necessary. + */ + window.checkAndAwardOrb = function() { + const now = Date.now(); + if (now - window.lastOrbTime >= ONE_HOUR) { + awardDreamOrb(); + } + }; + + // Periodic check - every 30 seconds should be plenty in normal use (you can crank this to 1 second for testing) + setInterval(checkAndAwardOrb, 30000); + + console.log('%c[DreamOrbOnline] Script loaded and running.', 'color: #4caf50; font-weight: bold;'); +})(); From 644c9ddbfef373125e0b4b1a95a949facfb8842a Mon Sep 17 00:00:00 2001 From: EasyGoinGaming Date: Wed, 5 Mar 2025 13:08:46 -0700 Subject: [PATCH 2/3] Create KeyStoneMining Allows Key Stones to be farmed at a very rare rate via Evolution Stone/Random Mines --- EGGEditsorAdds/KeyStoneMining | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 EGGEditsorAdds/KeyStoneMining diff --git a/EGGEditsorAdds/KeyStoneMining b/EGGEditsorAdds/KeyStoneMining new file mode 100644 index 0000000..9ae3226 --- /dev/null +++ b/EGGEditsorAdds/KeyStoneMining @@ -0,0 +1,68 @@ +(function () { + console.log("🔍 Checking dependencies before injecting Key Stone..."); + + const dependencies = { + App, + UndergroundItems, + UndergroundItem, + GameConstants, + UndergroundItemValueType, + StoneType: (typeof StoneType !== 'undefined') ? StoneType : "🚨 MISSING!" + }; + + for (const [key, value] of Object.entries(dependencies)) { + console.log(value === "🚨 MISSING!" ? `❌ ERROR: ${key} is missing!` : `✅ ${key} is loaded.`); + } + + if (dependencies.StoneType === "🚨 MISSING!") { + console.error("🚨 StoneType is missing! Attempting to load manually..."); + try { + StoneType = GameConstants.StoneType; // Try to assign it manually + console.log(`✅ Manually assigned StoneType: `, StoneType); + } catch (error) { + console.error("❌ Failed to assign StoneType! Aborting script.", error); + return; + } + } + + console.log("✅ All dependencies are loaded! Proceeding with injection..."); +})(); +(function () { + if (typeof App === 'undefined' || typeof UndergroundItems === 'undefined' || typeof UndergroundItem === 'undefined' || typeof GameConstants === 'undefined' || typeof UndergroundItemValueType === 'undefined' || typeof StoneType === 'undefined') { + console.error("❌ PokeClicker game or required modules not detected."); + return; + } + + console.log("Injecting Corrected Key Stone into Underground Mining Pool..."); + + // Create Key Stone Item with Correct Type Mapping + const keyStoneItem = new UndergroundItem( + 999, // Unique ID (should not conflict) + 'Key_stone', // Must match existing game data + [[1, 1, 1], [1, 1, 1], [1, 1, 1]], // 3x3 Shape for Round Object + 200, // Mining value + UndergroundItemValueType.EvolutionItem, // Set as Evolution Item + undefined, // No requirement, always unlocked + 0.01 // Lower weight = Rarer appearance + ); + + // Manually set type to ensure proper image path resolution + keyStoneItem.type = StoneType.Key_stone; + + // 🔥 Override the Underground Image Path to Prevent Errors + Object.defineProperty(keyStoneItem, 'undergroundImage', { + get() { + return `assets/images/items/evolution/key_stone.png`; // Forces Evolution Item Image + } + }); + + // Prevent Duplicate Injection + if (!UndergroundItems.list.some(item => item.itemName === 'Key_stone')) { + UndergroundItems.list.push(keyStoneItem); + console.log("✅ Key Stone successfully added with proper underground image, increased size & rarity!"); + } else { + console.log("⚠️ Key Stone already exists in Underground Items. Skipping injection."); + } + +})(); + From 86ae86aa9bce85a378652cdda814b1ce45839bdf Mon Sep 17 00:00:00 2001 From: EasyGoinGaming Date: Wed, 5 Mar 2025 13:11:09 -0700 Subject: [PATCH 3/3] Added Auto-Disable Timer simpleautofarmer.user.js Added timer function to auto-disable the farming tools. Especially useful in combination with the Pokeclicker Automation suite's farming tools - allowing a user to set timers to farm berries while the Automation suite is setting up to unlock new berries. --- simpleautofarmer.user.js | 95 +++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 17 deletions(-) diff --git a/simpleautofarmer.user.js b/simpleautofarmer.user.js index 372c014..88f0e15 100644 --- a/simpleautofarmer.user.js +++ b/simpleautofarmer.user.js @@ -19,17 +19,17 @@ // ==/UserScript==// function initAutoFarm() { - var autoFarmLoop; - var plantState; var harvestState; var replantState; var mulchState; + var autoFarmLoop; + var farmTimer; - plantState = JSON.parse(localStorage.getItem('autoPlantState')); - harvestState = JSON.parse(localStorage.getItem('autoHarvestState')); - replantState = JSON.parse(localStorage.getItem('autoReplantState')); - mulchState = JSON.parse(localStorage.getItem('autoMulchState')); + var plantState = JSON.parse(localStorage.getItem('autoPlantState')); + var harvestState = JSON.parse(localStorage.getItem('autoHarvestState')); + var replantState = JSON.parse(localStorage.getItem('autoReplantState')); + var mulchState = JSON.parse(localStorage.getItem('autoMulchState')); let plantSelected = JSON.parse(localStorage.getItem('autoPlantSelected')); FarmController.selectedBerry(plantSelected); @@ -44,13 +44,13 @@ function initAutoFarm() { var elemAF = document.createElement("div"); var divMenu1 = document.createElement("div"); var divMenu2 = document.createElement("div"); - const shovelList = document.getElementById('shovelList'); - divMenu1.className = "row justify-content-center py-0"; divMenu2.className = "row justify-content-center py-0"; elemAF.appendChild(divMenu1); elemAF.appendChild(divMenu2); + + const shovelList = document.getElementById('shovelList'); shovelList.before(elemAF); const createButton = (name, state, func, rl, top) => { @@ -62,21 +62,84 @@ function initAutoFarm() { button.className = 'btn btn-block btn-' + (state ? 'success' : 'danger'); button.style.height = '50px'; button.style.fontSize = '9pt'; - button.textContent = `Auto ${name[0].toUpperCase() + name.slice(1)}\n[${plantState ? 'ON' : 'OFF'}]`; - button.onclick = function() { func(); }; + button.textContent = `Auto ${name[0].toUpperCase() + name.slice(1)}\n[${state ? 'ON' : 'OFF'}]`; + button.onclick = func; buttonDiv.appendChild(button); - if (top) { - divMenu1.appendChild(buttonDiv); - } else { - divMenu2.appendChild(buttonDiv); - } + (top ? divMenu1 : divMenu2).appendChild(buttonDiv); } createButton('plant', plantState, autoPlantToggle, 'r', true); createButton('harvest', harvestState, autoHarvestToggle, 'l', true); createButton('replant', replantState, autoReplantToggle, 'r', false); createButton('mulch', mulchState, autoMulchToggle, 'l', false); + + createTimerUI(elemAF); // <- Move this to the bottom for better UX + } + + function createTimerUI(parent) { + var timerDiv = document.createElement('div'); + timerDiv.className = 'row justify-content-center py-0 mt-2'; + + var timerInput = document.createElement('input'); + timerInput.id = 'autoFarmTimer'; + timerInput.type = 'number'; + timerInput.min = '1'; + timerInput.placeholder = 'Minutes'; + timerInput.style.width = '80px'; + timerInput.className = 'form-control text-center'; + + var timerButton = document.createElement('button'); + timerButton.innerText = 'Start Timer'; + timerButton.className = 'btn btn-warning ml-2'; + timerButton.onclick = startAutoFarmTimer; + + var timerStatus = document.createElement('span'); + timerStatus.id = 'autoFarmTimerStatus'; + timerStatus.style.marginLeft = '10px'; + + timerDiv.appendChild(timerInput); + timerDiv.appendChild(timerButton); + timerDiv.appendChild(timerStatus); + parent.appendChild(timerDiv); + } + + function startAutoFarmTimer() { + clearInterval(farmTimer); + + const minutes = parseInt(document.getElementById('autoFarmTimer').value); + if (isNaN(minutes) || minutes <= 0) { + alert('Please enter a valid number of minutes.'); + return; + } + + const endTime = Date.now() + minutes * 60 * 1000; + updateTimerDisplay(endTime); + + farmTimer = setInterval(() => { + const timeLeft = endTime - Date.now(); + if (timeLeft <= 0) { + clearInterval(farmTimer); + disableAllFunctions(); + document.getElementById('autoFarmTimerStatus').innerText = 'Timer expired!'; + } else { + updateTimerDisplay(endTime); + } + }, 1000); + } + + function updateTimerDisplay(endTime) { + const timeLeft = endTime - Date.now(); + const minutesLeft = Math.floor(timeLeft / 60000); + const secondsLeft = Math.floor((timeLeft % 60000) / 1000); + document.getElementById('autoFarmTimerStatus').innerText = `Time left: ${minutesLeft}:${secondsLeft.toString().padStart(2, '0')}`; + } + + function disableAllFunctions() { + if (plantState) autoPlantToggle(); + if (harvestState) autoHarvestToggle(); + if (replantState) autoReplantToggle(); + if (mulchState) autoMulchToggle(); } function toggleFarmLoop() { @@ -326,6 +389,4 @@ function loadEpheniaScript(scriptName, initFunction, priorityFunction) { } } -if (!App.isUsingClient || localStorage.getItem('simpleautofarmer') === 'true') { loadEpheniaScript('simpleautofarmer', initAutoFarm, initSelectedBerryTracking); -}