Help with and Auto-Skip script

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

scubanarc
Posts: 1
Joined: Sat Jul 05, 2014 5:41 pm

Help with and Auto-Skip script

Post by scubanarc » Sat Jul 05, 2014 5:52 pm

Hey guys,

Apologies if this is the wrong sub. I'm new to the MediaMonkey scene.

I'd like to write a simple script that skips a track if "custom 1" has a certain value in it, let's say "true". I'm familiar with the event handlers example here: http://www.mediamonkey.com/wiki/index.p ... ers_script.

Do I need to use an event handler to do this? Can anyone provide me with some sample code to get me started? In pseudo-code what I want to do is:

if CurrentSong.Custom1 contains "true" then
SkipNext
end if

Any help is greatly appreciated.
Last edited by Lowlander on Sat Jul 05, 2014 9:14 pm, edited 1 time in total.
Reason: Moved to correct Forum

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: Help with and Auto-Skip script

Post by trixmoto » Sun Jul 06, 2014 12:03 pm

Yes, you'd want to use an "OnPlay" event, something like this...

Code: Select all

Call Script.RegisterEvent(SDB,"OnPlay","Event_OnPlay")

Sub Event_OnPlay()
  If SDB.Player.CurrentSong.Custom1 = "true" Then
    SDB.Player.Next
  End If
End Sub
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Post Reply