Blonder tongue MICM rack and power supply has arrived, along with two extra modulators because the seller was a nice person, while I wait for my first pi to arrive I've been asking AI questions to help me figure out where to start with writing LUA scripts to insert wholesome old timey ads to ease her mind, so far it's popped this out at me
"function descriptor()
return {
title = "Custom Playlist Scheduler",
version = "1.0",
author = "Your Name",
capabilities = {}
}
end
function activate()
-- Define your playlists
local corey_playlist = "path/to/corey_in_the_house.m3u"
local ads_playlist = "path/to/ads.m3u"
-- Schedule times (in seconds)
local schedule_times = {
{time = 18 * 3600 + 30 * 60, playlist = corey_playlist}, -- 6:30 PM
{time = 19 * 3600 + 0 * 60, playlist = ads_playlist} -- 7:00 PM
}
while true do
local current_time = os.time() % (24 * 3600) -- Get current time in seconds since midnight
for _, entry in ipairs(schedule_times) do
if current_time >= entry.time then
vlc.playlist.add(entry.playlist)
vlc.playlist.random() -- Randomize playback order
vlc.playlist.play()
break
end
end
vlc.misc.mwait(60000) -- Wait for one minute before checking again
end
end
function deactivate()
end"
It's telling me that this script is basically switching between two different playlists and that it will do this a set amount of times between 6:30pm and 7:00pm in this example, but I have a few questions
To add to this list do I just add more playlists for every other half hour slot? for example
" local schedule_times = {
{time = 18 * 3600 + 30 * 60, playlist = corey_playlist}, -- 6:30 PM[Expand Post] {time = 19 * 3600 + 0 * 60, playlist = ads_playlist} -- 7:00 PM
{time = 19 * 3600 + 0 * 60, playlist = Fawlty_towers} -- 7:30 PM
{time = 19 * 3600 + 0 * 60, playlist = top_gear} -- 8:00 PM
(I just picked random shows for the record)
Also looking at the code, I don't understand code at all but it just looks like it's going to play ads at 7:00pm rather than splitting the initial media up by swapping to the other playlist regularly, and I might need to do something extra for when a video stops playing
I'm sorry if this is a retarded thing to ask, I'm a collector of old tech and I love doing things with it but code is something that I just can't seem to understand intuitively, the pi should(!) arrive on monday so I will post some pictures of this then, it kind of makes me weirdly happy it came with the rack so I have the urge to show it off