Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions EGGEditsorAdds/DreamOrbGenerator
Original file line number Diff line number Diff line change
@@ -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;');
})();
68 changes: 68 additions & 0 deletions EGGEditsorAdds/KeyStoneMining
Original file line number Diff line number Diff line change
@@ -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.");
}

})();

95 changes: 78 additions & 17 deletions simpleautofarmer.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) => {
Expand All @@ -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() {
Expand Down Expand Up @@ -326,6 +389,4 @@ function loadEpheniaScript(scriptName, initFunction, priorityFunction) {
}
}

if (!App.isUsingClient || localStorage.getItem('simpleautofarmer') === 'true') {
loadEpheniaScript('simpleautofarmer', initAutoFarm, initSelectedBerryTracking);
}