Messagesound immer eingeschaltet?
Verfasst: 09.12.2012, 10:56
von Partyboy
Ich habe mal eine frage und zwar suche ich ein Script wenn man sich im chat einloggt dan soll bei Messagesound schon der hacken dran sein bei loginsound habe ich den Script gefunden.Aber nicht für Messagesound.
Könnt ihr mir mal Helfen.
Könnt ihr mir mal Helfen.
Script:Zeigen
// Version 2.0
var MsgUser = new Array();
var MsgSound = new Array();
/* Konfiguration */
// Sollen Gäste auch Messagesounds hören/aktivieren können? (1 = eingeschaltet, 0 = ausgeschaltet)
var MsgGuests = 1;
// Hier kann der Text, der vor der Checkbox im Eingabeframe steht, angepasst werden
var MsgSoundName = "Messagesound";
// Standardsound. Falls ein User nicht bei speziellen Messagesounds aufgelistet ist, wird der Sound abgespielt
var defaultMsgSound = "http://server"+chatData[0]+".webkicks.de/6.wav";
// Hier müssen die User mit speziellen Messagesounds aufgezeigt werden
// Muster:
// MsgUser[ZAHL] = "monster_radio";
// MsgSound[ZAHL] = "http://monsterradio.ucoz.de/horst.mp3";
// ZAHL muss bei 0 beginnen und kann unendlich weit steigen. Jede Zahl bitte nur einmal verwenden (also einmal für User und einmal für Sound)!
// User immer klein schreiben!
MsgUser[0] = "monster_radio";
MsgSound[0] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[1] = "discoboy";
MsgSound[1] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[2] = "klaus";
MsgSound[2] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[3] = "dj_schlumpfine";
MsgSound[3] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[4] = "DJ_Butterfly";
MsgSound[4] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[5] = "micky_maus";
MsgSound[5] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[6] = "sabinebrose";
MsgSound[6] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[7] = "jungfrau78";
MsgSound[7] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[8] = "vampie76";
MsgSound[8] = "http://monsterradio.ucoz.de/horst.mp3";
/* Ab hier bitte nichts mehr ändern! */
var formInfo = parent.info.document.forms[0]; var LsStopper = 0;
newMsgSound = new (function () {
var that = this;
this.MsgInt; this.activated; this.lastMsg = ""; this.audioTag = 0;
this.objType = (typeof document.createElement("bgsound").src != "undefined" && !myBrowser.Opera) ? "bgsound" : "embed";
that.objType = (!!document.createElement("audio").canPlayType && document.createElement("audio").canPlayType("audio/wav").match(/maybe|probably|true/i)) ? "audio" : that.objType;
this.start = function () {
if (!formInfo.MsgSound) {that.MsgBox()} else {that.checkBox()};
}
this.soundObj = function () {
that.stopObj();
var obj = document.createElement(that.objType);
if (that.objType == "embed") {
with (obj) {
type = "audio/wav";
width = 1;
height = 1;
hidden = true;
}
}
if (that.objType != "audio") obj.id = "bgSound_id";
return obj;
}
this.playSound = function () {
var tds = document.getElementsByTagName("td");
var ld = tds[tds.length-1];
if (tds.length != 0 && strip_tags(ld.innerHTML) != that.lastMsg && lineData(ld)[2] != myNick) {
that.lastMsg = strip_tags(ld.innerHTML);
if (lineData(ld)[0] != 4 && lineData(ld)[0] != 5 && !LsStopper) {
var soundID = MsgUser.indexOf(lineData(ld)[2].toLowerCase());
if (that.activated) {
var sObj = that.soundObj();
sObj.src = (soundID != -1) ? MsgSound[soundID] : defaultMsgSound;
if (that.objType != "audio" && (!myBrowser.WebKit || formInfo.message.value == "")) {
document.body.appendChild(sObj);
if (that.objType != "bgsound") window.setTimeout("with(formInfo){elements[elements.length-1].focus();message.focus();}", 850);
} else if (that.objType == "audio") {
that.audioTag = sObj;
sObj.play();
}
}
}
}
}
this.stopObj = function () {
if (that.audioTag != 0) that.audioTag.pause();
var ObjID = document.getElementById("bgSound_id");
if (document.getElementById("bgSound_id")) ObjID.parentNode.removeChild(ObjID);
}
this.checkBox = function () {
that.activated = formInfo.MsgSound.checked;
if (!that.activated) {
that.stopObj();
window.clearInterval(that.MsgInt);
} else {
var tds = document.getElementsByTagName("td");
that.lastMsg = (tds.length != 0) ? strip_tags(tds[tds.length-1].innerHTML) : "";
that.MsgInt = window.setInterval(function(){that.playSound();}, 800);
}
}
this.MsgBox = function () {
if (efIsLoad()) {
if (myStatus > 0 || MsgGuests) {
var Msgbox = parent.info.document.createElement("span");
Msgbox.innerHTML = ' ' + MsgSoundName + ': <input type="checkbox" name="MsgSound" onclick="parent.mainframe.newMsgSound.checkBox()" /> ';
Msgbox.title = "Spielt einen Signalton nach jeder Chatnachricht ab";
formInfo.insertBefore(Msgbox, formInfo.childNodes[0]);
}
} else {window.setTimeout(function(){that.MsgBox();}, 500);}
}
});
newMsgSound.start();
var MsgUser = new Array();
var MsgSound = new Array();
/* Konfiguration */
// Sollen Gäste auch Messagesounds hören/aktivieren können? (1 = eingeschaltet, 0 = ausgeschaltet)
var MsgGuests = 1;
// Hier kann der Text, der vor der Checkbox im Eingabeframe steht, angepasst werden
var MsgSoundName = "Messagesound";
// Standardsound. Falls ein User nicht bei speziellen Messagesounds aufgelistet ist, wird der Sound abgespielt
var defaultMsgSound = "http://server"+chatData[0]+".webkicks.de/6.wav";
// Hier müssen die User mit speziellen Messagesounds aufgezeigt werden
// Muster:
// MsgUser[ZAHL] = "monster_radio";
// MsgSound[ZAHL] = "http://monsterradio.ucoz.de/horst.mp3";
// ZAHL muss bei 0 beginnen und kann unendlich weit steigen. Jede Zahl bitte nur einmal verwenden (also einmal für User und einmal für Sound)!
// User immer klein schreiben!
MsgUser[0] = "monster_radio";
MsgSound[0] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[1] = "discoboy";
MsgSound[1] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[2] = "klaus";
MsgSound[2] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[3] = "dj_schlumpfine";
MsgSound[3] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[4] = "DJ_Butterfly";
MsgSound[4] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[5] = "micky_maus";
MsgSound[5] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[6] = "sabinebrose";
MsgSound[6] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[7] = "jungfrau78";
MsgSound[7] = "http://monsterradio.ucoz.de/horst.mp3";
MsgUser[8] = "vampie76";
MsgSound[8] = "http://monsterradio.ucoz.de/horst.mp3";
/* Ab hier bitte nichts mehr ändern! */
var formInfo = parent.info.document.forms[0]; var LsStopper = 0;
newMsgSound = new (function () {
var that = this;
this.MsgInt; this.activated; this.lastMsg = ""; this.audioTag = 0;
this.objType = (typeof document.createElement("bgsound").src != "undefined" && !myBrowser.Opera) ? "bgsound" : "embed";
that.objType = (!!document.createElement("audio").canPlayType && document.createElement("audio").canPlayType("audio/wav").match(/maybe|probably|true/i)) ? "audio" : that.objType;
this.start = function () {
if (!formInfo.MsgSound) {that.MsgBox()} else {that.checkBox()};
}
this.soundObj = function () {
that.stopObj();
var obj = document.createElement(that.objType);
if (that.objType == "embed") {
with (obj) {
type = "audio/wav";
width = 1;
height = 1;
hidden = true;
}
}
if (that.objType != "audio") obj.id = "bgSound_id";
return obj;
}
this.playSound = function () {
var tds = document.getElementsByTagName("td");
var ld = tds[tds.length-1];
if (tds.length != 0 && strip_tags(ld.innerHTML) != that.lastMsg && lineData(ld)[2] != myNick) {
that.lastMsg = strip_tags(ld.innerHTML);
if (lineData(ld)[0] != 4 && lineData(ld)[0] != 5 && !LsStopper) {
var soundID = MsgUser.indexOf(lineData(ld)[2].toLowerCase());
if (that.activated) {
var sObj = that.soundObj();
sObj.src = (soundID != -1) ? MsgSound[soundID] : defaultMsgSound;
if (that.objType != "audio" && (!myBrowser.WebKit || formInfo.message.value == "")) {
document.body.appendChild(sObj);
if (that.objType != "bgsound") window.setTimeout("with(formInfo){elements[elements.length-1].focus();message.focus();}", 850);
} else if (that.objType == "audio") {
that.audioTag = sObj;
sObj.play();
}
}
}
}
}
this.stopObj = function () {
if (that.audioTag != 0) that.audioTag.pause();
var ObjID = document.getElementById("bgSound_id");
if (document.getElementById("bgSound_id")) ObjID.parentNode.removeChild(ObjID);
}
this.checkBox = function () {
that.activated = formInfo.MsgSound.checked;
if (!that.activated) {
that.stopObj();
window.clearInterval(that.MsgInt);
} else {
var tds = document.getElementsByTagName("td");
that.lastMsg = (tds.length != 0) ? strip_tags(tds[tds.length-1].innerHTML) : "";
that.MsgInt = window.setInterval(function(){that.playSound();}, 800);
}
}
this.MsgBox = function () {
if (efIsLoad()) {
if (myStatus > 0 || MsgGuests) {
var Msgbox = parent.info.document.createElement("span");
Msgbox.innerHTML = ' ' + MsgSoundName + ': <input type="checkbox" name="MsgSound" onclick="parent.mainframe.newMsgSound.checkBox()" /> ';
Msgbox.title = "Spielt einen Signalton nach jeder Chatnachricht ab";
formInfo.insertBefore(Msgbox, formInfo.childNodes[0]);
}
} else {window.setTimeout(function(){that.MsgBox();}, 500);}
}
});
newMsgSound.start();