DC - Object_found

Play song if object is found

Verze ze dne 31. 12. 2022. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name	DC - Object_found
// @author	Unknow
// @version	1.1
// @grant       none
// @description	Play song if object is found
// @match	https://www.dreadcast.net/Main
// @namespace	InGame
// ==/UserScript==

var audioElement = new Audio("https://www.cjoint.com/data3/LLFa7LfRTQD_Guta-Adrenaline.mp3");
$('body').append(audioElement);
$("#DC_object_found").prop('volume', '1');

let barreAction = $('span.action.inlineBlock')[0];

$(document).ready( function() {
	function alert_user() {



        const string = barreAction.innerText;
        const regex = /Objet trouvé/i


        if (regex.test(string)) {

            audioElement.load();
            audioElement.play();

            const Timeout = setTimeout(audioElement.stop(), 3000);
        }
	}


	$(document).ajaxComplete( function(a,b,c) {
		if(/Check/.test(c.url)) {
			alert_user();
		}
	});
});
console.log('DC - Object found started');