IdlePixel SlapChop - Action Type

Split off of IdlePixel Slapchop for Action Types (Primary or Alt).

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/483502/1303944/IdlePixel%20SlapChop%20-%20Action%20Type.js

// ==UserScript==
// @name         IdlePixel SlapChop - Action Type
// @namespace    godofnades.idlepixel
// @version      0.1
// @description  Split off of IdlePixel Slapchop for Action Types (Primary or Alt).
// @author       GodofNades
// @license      MIT
// @match        *://idle-pixel.com/login/play/
// @grant        none
// ==/UserScript==

(function () {
	"use strict";

    
    function isPrimaryActionSlapchop(event) {
        const prop = IdlePixelPlus.plugins.slapchop.getConfig("primaryActionKey") || "none";
        if(prop=="none") {
            return !(event.altKey || event.ctrlKey || event.shiftKey);
        }
        else {
            return event[prop];
        }
    }

    function isAltActionSlapchop(event) {
        const prop = IdlePixelPlus.plugins.slapchop.getConfig("altActionKey") || "altKey";
        return event[prop];
    }

	window.isPrimaryActionSlapchop = isPrimaryActionSlapchop;
	window.isAltActionSlapchop = isAltActionSlapchop;
})();