Now Playing Script?

So, I have a Pandora station for Tied Tails and I’ve seen in another club it will mention a “now playing” song every so often.

Does anyone know of a script that can be used to do the same for a Pandora station?

I could write one. It depends on what you exactly want to achieve.

Shall it be sent as a message on song change, be part of the rooms description, maybe booth?
Shall it be real song names and change the song after the actual song duration or may all songs have the same duration?
Shall it link to the song on Spotify/YouTube?

Just to clarify I cannot guarantee that I will actual be creating one.

I was thinking of a script that would use the desc command to post which song is playing when the songs change. Though my station is on Pandora.

If you’re talking about the one down in Whoreson’s Hovel in The Underground, I helped co-write it.
If you give me details on what you want, such as what songs, the frequency, etc… I can give you a script and explain what each bit does so you can tweak it down the line.

I would also love to have that. I’m working on a major update which involves radio station.

Well, I’d be looking for something that actually takes from a Pandora station to post the song playing there. If that’s possible.

Room scripts cannot access data outside of Wolfery. The only option would be to run your own server and use a bot/character to communicate with the room script.
It would be possible in theory but I don’t think the afford you need would be worth it.

But actually then you could also just let the bot send the message inside the room. Like a DJ-Character of some sort.

1 Like

Alternatively, could they take the link data and song length to put it into an array, and then have the script cycle through that? Would be a whole lot simpler if not as interactive.

const MINUTES = 60 * 1000 // 1 minute = 60 milliseconds

// Change these 🔽
const MIN_DELAY = MINUTES * 5 // Must be smaller than MAX_DELAY
const MAX_DELAY = MINUTES * 10 // Must be bigger than MIN_DELAY

// List of songs to play
// Make sure to follow the list pattern
const songs = [
	["[Waiting to Strike](https://open.spotify.com/track/04BzrPieHG4XVGbF7t3MpV)", "Jesper Kyd"],
	["Africa", "Toto"],
	["She's a Rat", "Vornak Axid-12"],
	["Radio-friendly Song", "Unknown Artist"],
]

function pickRandom<T>(arr: T[]): T {
	return arr[i32(Math.floor(Math.random() * arr.length))]
}

function buildMessage(title: string, artist: string): string {
	// You can add templates, just follow the same naming scheme; use backticks ` around the texts, and %{title} or %{artist} where needed, and add a comma at the end
	const templates = [
		`A song begins to play on the radio: ${title} by ${artist}.`,
		`There is a crackling sound, and then ${title} can be heard coming from a pair of speakers in the corner of the room.`
	]
	return pickRandom(templates)
}

export function onActivate(): void {
	scheduleNext()
}

export function onMessage(addr: string, topic: string, data: string | null, sender: string): void {
	if (topic === "showSong") {
		const song = pickRandom(songs)
		Room.describe(buildMessage(song[0], song[1]))
		scheduleNext()
	}
}

function scheduleNext(): void {
	const delay = i64(Math.floor(Math.random() * (MAX_DELAY - MIN_DELAY))) + MIN_DELAY
	Script.post("#", "showSong", null, delay)
}

This is what I have.

A song will be anounced every 5 to 10 minutes.
You can change these delays by modifying these:

const MIN_DELAY = MINUTES * 5 // Must be smaller than MAX_DELAY
const MAX_DELAY = MINUTES * 10 // Must be bigger than MIN_DELAY

You can add songs by modifying the songs list:

const songs = [
	["[Waiting to Strike](https://open.spotify.com/track/04BzrPieHG4XVGbF7t3MpV)", "Jesper Kyd"],
	["Africa", "Toto"],
	["She's a Rat", "Vornak Axid-12"],
	["Radio-friendly Song", "Unknown Artist"],
]

The format for a new song is ["TITLE", "ARTIST"]

You can modify and add the announcements themselves by modifying the following:

const templates = [
		`A song begins to play on the radio: ${title} by ${artist}.`,
		`There is a crackling sound, and then ${title} can be heard coming from a pair of speakers in the corner of the room.`
	]

${title} and ${artist} will be replaced by the sections in songs, respectively, following the ["TITLE", "ARTIST"] pattern.

For both lists, make sure to end the line with a comma ,

Do note there’s zero railguards here, but if you encounter any issues, feel free to post here.

1 Like

What if I want to put in advertisements? Like, have each ad on the radio last about 20-30 seconds before putting in a full song that lasts 3-5 minutes?

I can tweak that for you, but keep in mind it’ll get pretty spammy and might be annoying after a while, especially as people try to RP there.

Sometimes, less is more.

// Version: 1.0.0
// Date: 2026-04-02

// Option Flags
// TODO: Shuffle mode
// TODO: Full random, or shuffle
// TODO: On/Off
// TODO: Prevent things from playing twice

const MINUTES = 60 * 1000 // 1 minute = 60,000 milliseconds

// Change these 🔽
const MIN_DELAY = MINUTES * 5  // Must be smaller than MAX_DELAY
const MAX_DELAY = MINUTES * 15 // Must be bigger than MIN_DELAY

// How often songs vs announcements play.
// Example: SONG_WEIGHT = 3, ANNOUNCEMENT_WEIGHT = 1 → songs play 75% of the time.
const SONG_WEIGHT = 2
const ANNOUNCEMENT_WEIGHT = 1

// List of songs — follow the [title, artist] pattern
const songs = [
	["[Waiting to Strike](https://open.spotify.com/track/04BzrPieHG4XVGbF7t3MpV?si=69abe0a3fb554288)", "Jesper Kyd"],
	["Africa", "Toto"],
	["She's a Rat", "Vornak Axid-12"],
	["Radio-friendly Song", "Unknown Artist"],
]

const announcements = [
	"Do you like feet? You deserve a paws. Come on down to Paws R' Us, right next door to Toebean Emporium!",
	"Do you have a problem with rats and other similar pests? Well, sucks to be you, they're legal citizens. This message was brought to you by The Underground."
]

function pickRandom<T>(arr: T[]): T {
	return arr[i32(Math.floor(Math.random() * arr.length))]
}

function buildSongMessage(title: string, artist: string): string {
	// Add templates using backticks. Use ${title} and ${artist} where needed.
	const templates = [
		`A song begins to play on the radio: ${title} by ${artist}.`,
		`There is a crackling sound, and then ${title} can be heard coming from a pair of speakers in the corner of the room.`,
	]
	return pickRandom(templates)
}

function buildAnnouncementMessage(text: string): string {
	// Add templates using backticks. Use ${text} where needed.
	const templates = [
		`The speakers crackle to life: "${text}"`,
		`A voice echoes through the room: "${text}"`,
	]
	return pickRandom(templates)
}

function buildMessage(): string {
	const total = SONG_WEIGHT + ANNOUNCEMENT_WEIGHT
	const roll = i32(Math.floor(Math.random() * total))

	if (roll < SONG_WEIGHT) {
		const song = pickRandom(songs)
		return buildSongMessage(song[0], song[1])
	} else {
		const announcement = announcements[i32(Math.floor(Math.random() * announcements.length))]
		return buildAnnouncementMessage(announcement)
	}
}

export function onActivate(): void {
	scheduleNext()
}

export function onMessage(addr: string, topic: string, data: string | null, sender: string): void {
	if (topic === "showSong") {
		Room.describe(buildMessage())
		scheduleNext()
	}
}

function scheduleNext(): void {
	const delay = i64(Math.floor(Math.random() * (MAX_DELAY - MIN_DELAY))) + MIN_DELAY
	Script.post("#", "showSong", null, delay)
}

Here. Let’s call this version 1.0.0
I’ll add some improvements down the line.

It should be straightforward to edit, but let me know if you have any questions or run into any issues.

2 Likes

No problem! Even though I started using the radio script for the Pacifica International Airport, I would like to know how can one put in command.