Shoutbox

A little advice - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: A little advice (/showthread.php?tid=78748)

A little advice by ArkaneArkade on 11-05-2007 at 02:07 AM

Hey guys.
I don't really want to do this, but I've been playing about for ages and can't come up with a suitable solution.

I have an XBMC script running, which changes my music whenever a broadcast is detected.  All f this is working fine (well, kinda), but I'm looking to add a status changer to it.
All I need is some solution so that when the media is set, it saves my status, and then sets me to busy, then when the media stops it sets it back to the original status.

I know that this should be easy enough, but I keep running into problems when the next song in a playlist begins, the status variable changes again, and so in the end, unless I play only 1 song/video, the status will just remain as busy.

I need a way to stop this from happening, while still only calling from the same functions.
eg.
When media starts/changes it is detected  and sets the media
When media stops the media is turned off

Any ideas would be hugely appreciated.
Cheers guys


RE: A little advice by phalanxii on 11-05-2007 at 02:52 AM

code:
function OnEvent_MyMediaChange(NewMedia) {
    var BlankMedia = "\\0Music\\00\\0\\0\\0\\0\\0\\0";
    if(NewMedia == "" || NewMedia == BlankMedia) {
        Debug.Trace("Media is now off.");
    } else if(Messenger.MyCurrentMedia == "" || Messenger.MyCurrentMedia == BlankMedia) {
        Debug.Trace("Media is now on.");
    }
}
Be aware that this event often contains a slight delay from when the media appears to be updated.

I hope this is what you wanted. This will catch when your media turns on, and when your media turns off, but not when your media changes.
RE: A little advice by ArkaneArkade on 11-05-2007 at 04:09 PM

That works absolutely perfectly phalaxii, thanks very much.
The delay only appears to occur when the media is stopped, so it actually works as a minor benefit to my script.
Very much appreciated :D