quote:
Originally posted by MeEtc
i would, but i'm using a different version. can you just post what you edited, so that I can change it?
to main.js at the bottom put:
var aSent = new Array();
then:
code:
function OnEvent_ChatWndSendMessage(wnd,message){
aSent[wnd.Handle] = message;
if(message.match(/\(!WAT\)/gi)){
return message.replace(/\(!WAT\)/gi,sendCurrentSong('Winamp',prefs.get('wat')));
}else if(message.match(/\(!IWAT\)/gi)){
return message.replace(/\(!IWAT\)/gi,sendCurrentSong('iTunes',prefs.get('wat')));
}else if(message.match(/\(!WWAT\)/gi)){
return message.replace(/\(!WWAT\)/gi,sendCurrentSong('WMP',prefs.get('wat')));
}else if(message.match(/\(!JWAT\)/gi)){
return message.replace(/\(!JWAT\)/gi,sendCurrentSong('jetAudio',prefs.get('wat')));
}else if(message.match(/\(!MWAT\)/gi)){
return message.replace(/\(!MWAT\)/gi,sendCurrentSong('MusicMonkey',prefs.get('wat')));
}
ob = {"text" : false}
triggerEvent("OnEvent_ChatWndSendMessage", wnd, message, ob);
if(ob.text){
return ob.text;
}
switch(message){
case "/pause" : getPlayer().Pause();return '';
case "/play" : getPlayer().Play();return '';
case "/stop" : getPlayer().Stop();return '';
case "/next" : getPlayer().Next();return '';
case "/prev" : getPlayer().Prev();return '';
case "/sendsong" : transferSong(wnd);return '';
case "/lyrics" : openLyricWnd();return'';
}
}
function OnEvent_ChatWndReceiveMessage(wnd, origin, message){
if (aSent[wnd.Handle] === message) {
delete aSent[wnd.Handle];
} else {
var remoteSong = prefs.get('remote/song');
var remoteSend = prefs.get('remote/send');
var remoteShare = prefs.get('remote/shared');
remoteSong = (remoteSong == -1 ) ? "!np" : remoteSong;
remoteSend= (remoteSend == -1 ) ? "!sendsong" : remoteSend;
remoteShare = (remoteShare == -1 ) ? "!addtoshared" : remoteShare;
if(remoteSong != "" && prefs.get('remote/enabled/song')){
if(message.match(new RegExp("^" + remoteSong.preg_quote() + "$","i"))){
wnd.SendMessage(sendCurrentSong());
}
}
if(remoteSend != "" && prefs.get('remote/enabled/send')){
if(message.match(new RegExp("^" + remoteSend.preg_quote() + "$","i"))){
if(!transferSong(wnd,1)){
wnd.SendMessage(prefs.get('notrunning').replace('{player}',"unknown"));
}
}
}
if(remoteShare != "" && prefs.get('remote/enabled/shared')){
if(message.match(new RegExp("^" + remoteShare.preg_quote() + "$","i"))){
copyToShareingFolder(wnd.Contacts, wnd);
}
}
}
}