Idle Quest Notifier

Enhances your Idle Quest experience with custom audio alerts!

// ==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)