Skip to Content
It is currently March 2nd, 2021, 12:32 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: May 3rd, 2020, 7:15 pm 
Offline
New User
New User

Joined: May 18th, 2011, 4:18 am
Posts: 6
Hello guys, greetings!

Apologies if I'm in the wrong forum! I want to ask if there is a way to make the below script start if a particular track by a particular artist is on the air. Thank you

Code:
Song := ActivePlayer.GetSongInfo();
AQuery := Query('select requestid from historylist order by id desc limit 1', [], true);
 if(Song['songtype']='S') and (AQuery['requestid'] > 0) then
begin


Last edited by DJ Cassio on May 4th, 2020, 10:47 am, edited 3 times in total.
Moved to PAL Forum, please use [code][/code] tags in the future


Top
 Profile  
Reply with quote  
PostPosted: May 4th, 2020, 10:46 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10526
Location: Denver, CO
The script you are showing is incomplete, where is the rest? Or are you looking for help in finishing it?

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: May 4th, 2020, 1:41 pm 
Offline
New User
New User

Joined: May 18th, 2011, 4:18 am
Posts: 6
Thank you much Cassio for responding.
The script I displayed is an example script that I am looking for help in finishing. I want it to send a now playing tweet when a particular song by a particular artist is on the air.


Top
 Profile  
Reply with quote  
PostPosted: May 4th, 2020, 2:08 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8155
Location: Cologne (Germany)
rnbvibes wrote:
The script I displayed is an example script that I am looking for help in finishing.

But that's not why he asked.

What you showed here is not really a script.
It looks like you cut a random 4 lines out of your PAL script to show what you're working on.
For a full script it's missing the variable declarations part on top and the actual "action" part at the bottom.


Nonetheless here is what you're looking to do:
Code:
{* Put your variable declarations here *}

PAL.Loop := True;
IF ActivePlayer.GetSongInfo['artist'] = 'ExampleArtist' THEN
BEGIN
{* put your script (minus the variable declarations) here *}
END;
WaitForPlayCount(1);


Make sure to perform no wait stuff inside the IF block. Should you need to perform additional waiting, you can easily transform any IF into a WHILE loop with only one iteration by 1. defining a boolean variable set to true by default, 2. checking that variable AND "your IF-condition" in the WHILE header, 3. setting the variable from step 1 to false as the very first task inside your WHILE loop (optionally: 4. reset the variable to true after the WHILE loop's END;

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: May 5th, 2020, 8:27 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10526
Location: Denver, CO
rnbvibes wrote:
I want it to send a now playing tweet when a particular song by a particular artist is on the air.

I would suggest starting with Mastacheata's songposter script to hook your now playing tweet to Twitter and/or Facebook. It can be modified to fire when a particular artist is playing. See this post to get started viewtopic.php?p=210999#p212055

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group