IdlePixel SlapChop - Woodcutting Code

Split off of IdlePixel Slapchop for all Woodcutting Code.

Този скрипт не може да бъде инсталиран директно. Това е библиотека за други скриптове и може да бъде използвана с мета-директива // @require https://update.greasyfork.org/scripts/483555/1304279/IdlePixel%20SlapChop%20-%20Woodcutting%20Code.js

// ==UserScript==
// @name         IdlePixel SlapChop - Woodcutting Code
// @namespace    godofnades.idlepixel
// @version      0.1
// @description  Split off of IdlePixel Slapchop for all Woodcutting 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 LOGS = Object.keys(Cooking.LOG_HEAT_MAP);

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

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

	function initQuickFoundry() {
		let html = `
        <div id="slapchop-quickfoundry" class="slapchop-quickfight">
          <h5>Quick Foundry:</h5>
          <div class="slapchop-quicksmelt-buttons">
        `;
		window.LOGS.forEach((log) => {
			if (log != "dense_logs") {
				html += `
              <button id="slapchop-quickfoundry-${log}" type="button" onclick="window.quickFoundry('${log}')">
                <img src="${IMAGE_URL_BASE}/${log}.png" class="img-20" />
                ${log
									.replace("_logs", "")
									.replace(/_/g, " ")
									.replace(/(^|\s)\w/g, (s) => s.toUpperCase())}
                (<span data-slap="max-foundry-${log}">?</span>)
              </button>
            `;
			}
		});
		html += `
          </div>
          <hr>
        </div>
        `;
		$("#panel-woodcutting hr").first().after(html);
	}

	function updateQuickFoundry() {
		const foundryBusy =
			IdlePixelPlus.getVarOrDefault("foundry_amount", 0, "int") != 0;
		LOGS.forEach((log) => {
			if (log != "dense_logs") {
				const max = window.maxFoundry(log);
				$(`[data-slap="max-foundry-${log}"]`).text(max);
				if (!foundryBusy && max > 0) {
					$(`#slapchop-quickfoundry-${log}`).prop("disabled", false);
				} else {
					$(`#slapchop-quickfoundry-${log}`).prop("disabled", true);
				}
			}
		});
	}

	function quickFoundry(log) {
		if (foundryToggle) {
			foundryToggle = false;
			const max = window.maxFoundry(log);
			if (max > 0) {
				IdlePixelPlus.sendMessage(`FOUNDRY=${log}~${max}`);
			}
			setTimeout(function () {
				foundryToggle = true;
			}, 1000);
		}
	}

	function maxFoundry(log) {
		if (IdlePixelPlus.getVarOrDefault("charcoal_foundry_crafted", "0") != "1") {
			return 0;
		}
		let max = IdlePixelPlus.getVarOrDefault(log, 0, "int");
		let foundryStorage = IdlePixelPlus.getVarOrDefault(
			"foundry_storage_crafted",
			0,
			"int"
		);

		if (max >= 1000 && foundryStorage == 1) {
			max = 1000;
		} else if (max > 100 && foundryStorage != 1) {
			max = 100;
		}

		let oilMax = Math.floor(
			IdlePixelPlus.getVarOrDefault("oil", 0, "int") / 10
		);
		if (max > oilMax) {
			max = oilMax;
		}
		return max;
	}

	function initQuickChop() {
		$("#panel-woodcutting itembox").first().before(`
        <itembox id="slapchop-lumberjack" class="shadow hover" data-item="slapchop_lumberjack" onclick="window.quickChop()">
            <div class="center mt-1"><img width="50" height="50" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsEAAA7BAbiRa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+//LLa44fvl4GdNi7bPny+Uqu9VW5WBBhtjnQ1KLeb3TyGh1szqnpM2acfnDpg4eIafLSanUpAQF+jWazJYBc5DOxcQmXzfB7+c3q1dH1laWr2OZuJY/thMFog8lhR9SwFPBFkk8nTZx48K677nKLpThucYtb3OIWt+gB+H8ajA/HL9a+bQAAAABJRU5ErkJggg=="></div>
            <div class="center mt-2">Chop</div>
        </itembox>
        `);
		$("#panel-woodcutting itembox").first().after(`
        <itembox id="slapchop-rain-pot" class="shadow hover" data-item="slapchop_rainpot" onclick="websocket.send(DRINK=rain_potion)">
            <div class="center mt-1"><img width="50" height="50" src="https://d1xsc8x7nc5q8t.cloudfront.net/images/rain_potion.png" title="rain_potion"></div>
            <div class="center mt-2">Chop</div>
        </itembox>
        `);
	}

	function quickChop() {
		for (let i = 1; i <= 5; i++) {
			let status = IdlePixelPlus.getVarOrDefault("tree_stage_" + i, 0, "int");
			let treeType = IdlePixelPlus.getVarOrDefault("tree_" + i, "none");
			let sdCut = IdlePixelPlus.plugins.slapchop.getConfig("quickChopSDTreesEnabled");
			let regCut = IdlePixelPlus.plugins.slapchop.getConfig("quickChopRegTreesEnabled");
			if (
				(status == 4 && treeType != "stardust_tree" && treeType != "tree") ||
				(status == 4 && treeType == "stardust_tree" && sdCut) ||
				(status == 4 && treeType == "tree" && regCut)
			) {
				IdlePixelPlus.sendMessage("CHOP_TREE=" + i);
			}
		}
	}

	window.initQuickFoundry = initQuickFoundry;
	window.initQuickBurn = initQuickBurn;
	window.initQuickChop = initQuickChop;
	window.quickBurn = quickBurn;
	window.quickFoundry = quickFoundry;
	window.maxFoundry = maxFoundry;
	window.quickChop = quickChop;
	window.updateQuickFoundry = updateQuickFoundry;
	window.LOGS = LOGS;
})();