Melvor Slayer Task Notification

Gives you a notification on Completion of Slayer Task

当前为 2020-08-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         Melvor Slayer Task Notification
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  Gives you a notification on Completion of Slayer Task
// @author       Breindahl#2660
// @match        https://*.melvoridle.com/*
// @grant        none
// ==/UserScript==
/* jshint esversion: 6 */

// Made for version 0.16.2

(main => {
    var script = document.createElement('script');
    script.textContent = `try {(${main})();} catch (e) {console.log(e);}`;
    document.body.appendChild(script).parentNode.removeChild(script);
})(() => {


// Loading script
console.log('Melvor Slayer Task Notification Loaded');

function updateSlayerTaskOverwrite(qty) {
    if (qty > 0) {
        slayerTask[0].count -= qty;
        if (!petUnlocked[19]) rollForPet(19, playerAttackSpeed);
        if (slayerTask[0].count < 1) {
            previousSlayerTask = slayerTask[0].monsterID;
            slayerTask = [];
				notifyPlayer(CONSTANTS.skill.Slayer, 'You have completed your Slayer task.', 'success');
                // Notification sound added
                let ding = new Audio("https://www.myinstants.com/media/sounds/ding-sound-effect.mp3");
                ding.volume=0.5;
                ding.play();
                // End of modification
            if (autoSlayerTask) getSlayerTask();
        }
    }
    if (!slayerTask.length) {
        $('#combat-player-slayer-task').html('<button type="button" class="btn btn-sm btn-success" onclick="getSlayerTask();">New Task</button>');
    } else {
        $('[data-toggle="tooltip"]').tooltip('hide');
        let a = findEnemyArea(slayerTask[0].monsterID);
        let cost = getSlayerCost();
        $('#combat-player-slayer-task').html('<img class="skill-icon-xs m-0 mr-2 js-tooltip-enabled" src="' + MONSTERS[slayerTask[0].monsterID].media + '" data-toggle="tooltip" data-html="true" data-placement="bottom" title data-original-title="<small>Found in:</small><br><span class=\'text-warning\'>' + a + '</span>"><a class="combat-action" href="#" onClick="jumpToEnemy(' + slayerTask[0].monsterID + '); return false;">' + numberWithCommas(slayerTask[0].count) + ' x ' + MONSTERS[slayerTask[0].monsterID].name + '</a>');
        $('#combat-player-slayer-new-btn').html('<a class="pointer-enabled combat-action" id="slayer-task-refresh" href="#" onclick="newSlayerTask(); return false;"><small>New Task</small></a>');
    }
}

window.updateSlayerTask = function(...args) {
    updateSlayerTaskOverwrite(...args);
};

});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址