Greasy Fork is available in English.

IdlePixel SlapChop - Farming Code

Split off of IdlePixel Slapchop for all Farming Code.

Acest script nu ar trebui instalat direct. Aceasta este o bibliotecă pentru alte scripturi care este inclusă prin directiva meta a // @require https://update.greasyfork.org/scripts/483549/1304251/IdlePixel%20SlapChop%20-%20Farming%20Code.js

// ==UserScript==
// @name         IdlePixel SlapChop - Farming Code
// @namespace    godofnades.idlepixel
// @version      0.1
// @description  Split off of IdlePixel Slapchop for all Farming Code.
// @author       GodofNades
// @license      MIT
// @match        *://idle-pixel.com/login/play/
// @grant        none
// ==/UserScript==

(function () {
	"use strict";

	let singleOverride;

	const IMAGE_URL_BASE = document
		.querySelector("itembox[data-item=copper] img")
		.src.replace(/\/[^/]+.png$/, "");

	const BONEMEALABLE = [
		"bones",
		"big_bones",
		"ice_bones",
		"ashes",
		"blood_bones",
	];

	const PLANTABLES = $('itembox[data-item$="_seeds"]')
		.toArray()
		.map((el) => el.getAttribute("data-item"));

	function quickBone(item, alt) {
		if (IdlePixelPlus.getVarOrDefault("bonemeal_bin", 0, "int") != 0) {
			let n = IdlePixelPlus.getVarOrDefault(item, 0, "int");
			singleOverride =
				IdlePixelPlus.plugins.slapchop.getConfig("autoSingleEnabled");
			if (alt || singleOverride) {
				n--;
			}
			if (n > 0) {
				IdlePixelPlus.sendMessage(`ADD_BONEMEAL=${item}~${n}`);
			}
		}
	}

	function initQuickBones() {
		window.BONEMEALABLE.forEach((item) => {
			$(`itembox[data-item="${item}"]`).on("contextmenu", (event) => {
				if (
					IdlePixelPlus.plugins.slapchop.getConfig("quickBoneRightClickEnabled")
				) {
					const primary = window.isPrimaryActionSlapchop(event);
					const alt = window.isAltActionSlapchop(event);
					if (primary || alt) {
						window.quickBone(item, !primary);
						event.stopPropagation();
						event.preventDefault();
						return false;
					}
				}
				return true;
			});
		});
	}

	function initQuickHarvest() {
		$("#panel-farming itembox").first().before(`
            <itembox id="slapchop-bob" class="shadow hover" data-item="slapchop_bob" onclick="IdlePixelPlus.plugins.slapchop.quickHarvest()">
                <div class="center mt-1"><img width="50" height="50" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADr8AAA6/ATgFUyQAACJ9SURBVHhe7V0JnF1Vef/uW+7bl1ne7GsymWTISgxZMCAgWnEBWVxKW6WCVbv8Smmt/NqCuCCiNi3+rFoRBUUrkIo0xQAhEAgkIWTPZJ9MZp95y7x9X/v9z71vksmiySSZ91L5w5lz77nLe+/7n28759wbegfv4KLg3ntJp25e0pDU+pJEa4Vh6YxKw9+1O7Uftxm0mmw+T5lsnrKkKXji+Z0D4fwTe4bC31VPvyRwSRKypNl6WZNN89hMh7S8wqSjfKFAWq2OckxILl/gXyVxTZTI5MmXyNOxKK32Jwv3dQ+GDqq3KFto1fqSwbUd1j9f5NK8NM+lbzLrJSaC+xSToNFqKM+EUEEi5kd0NQ0TY5E11GCWLrPopL+2W2W5ssa8ye1LZpW7lR8uKQ25vsP6xRWN+m+5LHAXrAVQA42G0tkcaXU6SrNGgBP+n3mRKMtEQWEKOJfraCpLQwntVk9a9/k/+sTndq/6169/ZEaFeZ7ToteYdBopm81JfE9Jy/fU6vV5dyiZcQeSPxiJpILiC0wDLhlCrplV+bGV9YWnq01a5kDDQiZhogqShv3GcUJyrB55/lmCBGYDnIEckJTK5PgXa6g/nCODTiKbNkdGroUY+P8CaxfMHQCyM1yGYhL1BHLvO+oOvywOXGRcEiZrcWvVvKW19KrLrCEWqRAuen6Gu32ehZjluqgRIADHoBHQliJBTB2fpxBoZRKyfJ3TCHJVEgQREldKEQxxHUvnKKc3W0b80ae58aJDo9ZljSZL5hfVRokJINaCApsorrHNNUhJMwOsHGIbpIha3c4yMYi+WIlEWw6FSdJrCpTgNmhaQTgdbCs1KmwPh9IU4JPCidRG5cDFB7pC2aHdZbp9Xp35WpuU/hQ7Zb3dqJfsMn9VFhxEJqFX81eHyZK4x6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/9vQfR/q9V/Nv8z/AAAAAAASUVORK5CYII="></div>
                <div class="center mt-2">Harvest</div>
            </itembox>
        `);
	}

	function quickHarvest() {
		for (let i = 1; i <= 5; i++) {
			let status = IdlePixelPlus.getVarOrDefault("farm_stage_" + i, 0, "int");
			if (status == 4) {
				IdlePixelPlus.sendMessage("CLICKS_PLOT=" + i);
			}
		}
	}

	function quickPlant(seed, alt) {
		let n = IdlePixelPlus.getVarOrDefault(seed, 0, "int");
		singleOverride =
			IdlePixelPlus.plugins.slapchop.getConfig("autoSingleEnabled");
		if (alt || singleOverride) {
			n--;
		}
		if (!alt && !singleOverride && n > 1) {
			n = 1;
		}
		const donor = DonorShop.has_donor_active(
			Items.getItem("donor_farm_patches_timestamp")
		);
		const maxPlot = donor ? 5 : 3;
		for (let plot = 1; plot <= maxPlot && n > 0; plot++) {
			if (IdlePixelPlus.getVar(`farm_${plot}`) == "none") {
				IdlePixelPlus.sendMessage(`PLANT=${seed}~${plot}`);
				n--;
			}
		}
	}

	function initQuickPlant() {
		window.PLANTABLES.forEach((item) => {
			$(`itembox[data-item="${item}"]`).on("contextmenu", (event) => {
				if (
					IdlePixelPlus.plugins.slapchop.getConfig(
						"quickPlantRightClickEnabled"
					)
				) {
					const primary = window.isPrimaryActionSlapchop(event);
					const alt = window.isAltActionSlapchop(event);
					if (primary || alt) {
						if (
							IdlePixelPlus.plugins.slapchop.getConfig(
								"quickPlantHarvestRightClickEnabled"
							)
						) {
							window.quickHarvest();
						}
						window.quickPlant(item, !primary);
						event.stopPropagation();
						event.preventDefault();
						return false;
					}
				}
				return true;
			});
		});
	}

	window.initQuickBones = initQuickBones;
	window.initQuickHarvest = initQuickHarvest;
	window.initQuickPlant = initQuickPlant;
	window.quickBone = quickBone;
	window.quickHarvest = quickHarvest;
	window.quickPlant = quickPlant;
	window.BONEMEALABLE = BONEMEALABLE;
	window.PLANTABLES = PLANTABLES;
})();