DC - Object_found

Play song if object is found

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

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.

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

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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