DC - Object_found

Play song if object is found

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

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

var audioElement = new Audio("https://www.thesoundarchive.com/email/tarzan-screaming.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');