O.P. RE: !sendsong script
I have got DT's now playing script working for my friend, however for me, I use SAM Broadcaster.
The Paths are stored as "E:\My Music\deejay playboy-im my dreams (who is dj carlee).mp3" by the player.
When I manualy edit the XML file to replace the \ with \\ and use a file with no special chars in its name, it works. How do i edit this to make the variable locationVar SendFile friendly!
Please no "bob's script does this", i wanna learn
[code]
function OnEvent_ChatWndReceiveMessage(wnd, origin, message)
{
if(origin != Messenger.MyName){
MsgPlus.AddTimer("MessagesTimer", 4000);
file = MsgPlus.ScriptFilesPath + "\\output.xml";
//Load the status of the script and the list of messages.
XMLDoc = new ActiveXObject("Microsoft.XMLDOM");
XMLDoc.aync = false;
XMLDoc.load(file);
//Load values from the xml file.
version = XMLDoc.getElementsByTagName("version");
timer = XMLDoc.getElementsByTagName("timer");
artist = XMLDoc.getElementsByTagName("artist");
title = XMLDoc.getElementsByTagName("title");
played = XMLDoc.getElementsByTagName("played");
playedVar = played[Math.floor(Math.random()*played.length)].text;
location = XMLDoc.getElementsByTagName("location");
locationVar = location[Math.floor(Math.random()*location.length)].text;
if(message == "!test"){
wnd.SendFile(locationVar);
}
}
}
Edit:
It works, it just stops some right click functions working till i close window. How do I avoid this?
This post was edited on 01-25-2007 at 07:38 PM by mad_willsy.
|