Idle Quest Notifier

Enhances your Idle Quest experience with custom audio alerts!

目前為 2023-12-17 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Idle Quest Notifier
// @namespace https://www.iqrpg.com/game.html
// @version 1.0
// @description Enhances your Idle Quest experience with custom audio alerts!
// @author Grogu2484
// @match http://iqrpg.com/game.html
// @match https://https://test.iqrpg.com/game.html
// @grant none
// ==/UserScript==

// Set your preferred volume level (0-min, 1-max)
var masterAudioLevel = 0.8;

// Auto alerts configuration
var autoAudioAlert = true;
var autoAlertSoundURL = 'https://your-audio-host.com/auto-alert.mp3';
var autoAlertRepeatInSeconds = 2;
var autoAlertNumber = 25;
var autoMaxNumberOfAudioAlerts = 0;
var autoDesktopAlert = true;

// Dungeon alerts configuration
var dungeonAudioAlert = true;
var dungeonDesktopAlert = true;

// Boss alerts configuration
var bossAudioAlert = true;
var bossAlertSoundURL = 'https://your-audio-host.com/boss-alert.mp3';
var bossDefeatedSoundURL = 'https://your-audio-host.com/boss-defeated.mp3';
var bossDesktopAlert = true;

// Event alerts configuration
var eventDesktopAlert = true;
var eventAlert_Woodcutting = true;
var eventAlert_Quarrying = true;
var eventAlert_Mining = true;
var eventAudioAlert = true;
var eventAudioAlertFinished = false;
var eventAlertSoundURL = 'https://your-audio-host.com/event-alert.mp3';

// ... (Continue with other configurations)

// Function to play audio
function playAudio(soundURL) {
    var audio = new Audio(soundURL);
    audio.volume = masterAudioLevel;
    audio.play();
}

// ... (Continue with other functions)

// Main function to handle events
function handleEvents(event) {
    // Customized event handling based on your preferences
    // ...

    // Example: Woodcutting event
    if (event.data.type === "woodcutting" && eventAlert_Woodcutting) {
        if (eventAudioAlert) {
            playAudio(eventAlertSoundURL);
        }
        if (eventDesktopAlert) {
            notifyUser('Idle Quest Event!', 'Woodcutting event has started!');
        }
        // ... (Continue with other event handling)
    }
}

// Function to notify the user
function notifyUser(title, message) {
    if (Notification.permission !== "denied") {
        Notification.requestPermission().then(function (permission) {
            if (permission === "granted") {
                var notification = new Notification(title, { body: message });
            }
        });
    }
}

// ... (Continue with other functions and event listeners)