Luvie / rv

// ==UserScript==
// @name         rv
// @version      0.0.5
// @author       开启报番型,作者 aoarashi1988,Handle修改
// @grant        unsafeWindow
// @include      https://mahjongsoul.game.yo-star.com/*
// @include      https://game.mahjongsoul.com/*
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function autoRun() {
        try {
            const arrBackup = cfg.voice.sound.groups_
            if (!arrBackup || arrBackup.length === 0) {
                throw new Error()
            }
            Object.entries(cfg.voice.sound.groups_).forEach(([soundID, soundGroup]) => {
                soundGroup.forEach((soundObject, index) => {
                    soundObject.level_limit = 0
                    soundObject.bond_limit = 0
                })
            })
        } catch (error) {
            requestAnimationFrame(autoRun)
        }
    }

    const reportVoice = setInterval(() => {
        if (game) {
            clearInterval(reportVoice)
            requestAnimationFrame(autoRun)
        }
    }, 1000)
})();