It should be possible and I will try to implement it tomorrow, OK?
BTW How many beers do you had?
Edit:
Here it is:
Code: Select all
...
Code: Select all
...
judas wrote: i actually did drink a few beers...im from COlombia and the soccer final was held yesterday lol (yes..my team won)
judas wrote: mmm......and no, i cant get enough...can you please now add an option so it calls my mobile automatically every time a song is played twice in less than 5 minutes?? oh...and can you make it scratch my back as well? LOL
Code: Select all
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Save this File (MusicNonStop.vbs) in MediaMonkey\Scripts\Auto
'and add the following Lines to MediaMonkey\Scripts\Scripts.ini
'(without apostrophes):
'
'[MusicNonStop]
'FileName=Auto\MusicNonStop.vbs
'ProcName=MusicNonStop
'Order=10
'DisplayName=MusicNonStop
'Description=MusicNonStop
'Language=VBScript
'ScriptType=2
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Option Explicit
const inclPersistent = False 'show Playlists like "Last 50 played", ... or not
const MaxTracksAdd = 3 'how many selectable Tracks are shown in Menu
const ObjName = "MusicNonStopPlaylist" 'Name of the Objects stored within MediaMonkey
'Create MenuItem
Sub OnStartUp
Dim MenuItem
Dim MenuItemSub
Dim strTemp
Dim boolTemp
Dim intTemp
Dim a
'MenuEntries Playlists
SDB.UI.AddMenuItemSep SDB.UI.Menu_Play, -1, -1
Set MenuItemSub = SDB.UI.AddMenuItemSub(SDB.UI.Menu_Play, -1, -1)
MenuItemSub.Caption = "Music Non Stop"
MenuItemSub.UseScript = Script.ScriptPath
MenuItemSub.OnClickFunc = "ShowPlaylists"
SDB.Objects(objName) = MenuItemSub
'MenuEntry >Yes<
Set MenuItem = SDB.UI.AddMenuItem(MenuItemSub, -1, -1)
MenuItem.Caption = SDB.Localize("Yes")
MenuItem.Hint = "On last Track of Now Playing, Tracks from selected Playlist will be added"
MenuItem.Enabled = True
MenuItem.UseScript = Script.ScriptPath
MenuItem.OnClickFunc = "SwitchOnOff"
strTemp = SDB.IniFile.StringValue("Player", "NonStop")
if strTemp = "" then boolTemp = False else boolTemp = CBool(strTemp)
MenuItem.Checked = boolTemp
Set MenuItem = Nothing
SDB.UI.AddMenuItemSep MenuItemSub, -1, -1
strTemp = SDB.IniFile.StringValue("Player", "NonStopNo")
if strTemp = "" then intTemp = 0 else intTemp = CInt(strTemp)
'Menu entries >No of Tracks<
for a = 0 to MaxTracksAdd
Set MenuItem = SDB.UI.AddMenuItem(MenuItemSub, -1, -1)
if a = 0 then MenuItem.Caption = SDB.Localize("All") else MenuItem.Caption = a
if a <> 1 then MenuItem.Caption = MenuItem.Caption & " " & SDB.Localize("Tracks") else MenuItem.Caption = MenuItem.Caption & " " & SDB.Localize("Track")
'MenuItem.Hint = MenuItem.Caption & " of the Playlist will be added"
MenuItem.Enabled = True
MenuItem.UseScript = Script.ScriptPath
MenuItem.OnClickFunc = "SetNumber"
MenuItem.Checked = (intTemp = a)
SDB.Objects(objName & "No" & a) = MenuItem
Set MenuItem = Nothing
next
SDB.UI.AddMenuItemSep MenuItemSub, -1, -1
Set MenuItemSub = Nothing
end Sub
'Switch MusicNonStop On/Off
Sub SwitchOnOff(MenuItem)
MenuItem.Checked = not MenuItem.Checked 'Change
SDB.IniFile.StringValue("Player", "NonStop") = MenuItem.Checked 'Save
End Sub
'Add Tracks to NowPlaying, if last Track starts playing
Sub MusicNonStop
Dim strTemp
Dim boolTemp
Dim PlaylistName
Dim PlaylistTracks
Dim a
Dim NoTracks
Dim rndItem
if SDB.Player.CurrentSongIndex = SDB.Player.PlaylistCount-1 then
strTemp = SDB.IniFile.StringValue("Player", "NonStop")
if strTemp = "" then boolTemp = False else boolTemp = CBool(strTemp)
if boolTemp then
PlaylistName = SDB.IniFile.StringValue("Player", "NonStopPlaylist")
Set PlaylistTracks = SDB.PlaylistByTitle(PlaylistName).Tracks
strTemp = SDB.IniFile.StringValue("Player", "NonStopNo")
if strTemp = "" then NoTracks = 0 else NoTracks = CInt(strTemp)
if strTemp = 0 then
'Last Track -> add all Tracks from Playlist "My Playlist"
SDB.Player.PlaylistAddTracks(PlaylistTracks)
elseif PlaylistTracks.Count > 0 then
'Add # of randomly selected Tracks from Playlist to Now Playing
Randomize Timer
for a = 1 to NoTracks
rndItem = Int((PlaylistTracks.Count-1) * Rnd)
SDB.Player.PlaylistAddTrack(PlaylistTracks.Item(rndItem))
next
end if
Set PlaylistTracks = Nothing
end if
end if
End Sub
'Save No of Tracks in INI-File and mark the Entry as checked
Sub SetNumber(MenuItem)
Dim strTemp
Dim intTemp
Dim a
strTemp = MenuItem.Caption
strTemp = Trim(Left(strTemp, Instr(strTemp, " ")))
if strTemp = SDB.Localize("All") then intTemp = 0 else intTemp = CInt(strTemp)
'Save to Ini
SDB.IniFile.StringValue("Player", "NonStopNo") = intTemp
for a = 0 to MaxTracksAdd
SDB.Objects(objName & "No" & a).Checked = (a = intTemp)
next
end Sub
'Create SubMenus for Playlist-Selection
Sub ShowPlaylists(MenuItem)
Dim DataSet
Dim PLCount
Dim Counter
Dim PLMenu
Dim SelectedPL
Dim SQL
SelectedPL = SDB.IniFile.StringValue("Player", "NonStopPlaylist")
Set DataSet = SDB.Database.OpenSQL("Select Max(IDPlaylist) from Playlists")
PLCount = DataSet.ValueByIndex(0)
Set DataSet = Nothing
for Counter = 1 to PLCount + 10 'tolerance (for created Playlists which where immediately deleted)
Set PLMenu = SDB.Objects(objName & Counter)
SQL = "Select PlaylistName from Playlists WHERE IDPlaylist = " & Counter
if not inclPersistent then SQL = SQL & " AND Persistent IS NULL"
Set DataSet = SDB.Database.OpenSQL(SQL)
if DataSet.EOF and (not (PLMenu is Nothing)) then
PLMenu.Enabled = False
PLMenu.Checked = False
elseif not Dataset.EOF then
if PLMenu is Nothing then
Set PLMenu = SDB.UI.AddMenuItem(SDB.Objects(objName), -1, -1)
PLMenu.Hint = Counter
PLMenu.UseScript = Script.ScriptPath
PLMenu.OnClickFunc = "SelectPlaylist"
SDB.Objects(objName & Counter) = PLMenu
end if
PLMenu.Caption = DataSet.StringByIndex(0)
PLMenu.Enabled = True
PLMenu.Checked = (SelectedPL = PLMenu.Caption)
end if
Set DataSet = Nothing
Set PLMenu = Nothing
next
end Sub
'Save Playlist-Selection
Sub SelectPlaylist(MenuItem)
SDB.IniFile.StringValue("Player", "NonStopPlaylist") = MenuItem.Caption
End Sub
thats from the first post...perhaps reading before asking is a good idea...judas wrote: what im looking for is for a script that automatically autocues a song from a seleceted location when the end of the Now Playing list is reached...so to have music on all the time.
the automatic track would be a random track from either a specific playlist and it should be easy to turn on/off (as with a tick on AUtocue on/off).
BTW you can change the Number in this Linejudas wrote:i have it set to add one song as well...sometimes i like adding 3, that way i have the option to delete one of those if i dont want to listen to it next
Code: Select all
const MaxTracksAdd = 3