Skip to Content
It is currently December 7th, 2019, 5:13 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Pal to clear Que
PostPosted: June 10th, 2014, 5:14 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
I need a pal script that will clear the queue at a specific time ,BUT will not remove "requested" songs from queue. Anyone??


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 10th, 2014, 5:03 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
You can either do it with an SQL query (this is the easy way):
Code:
ExecSQL('DELETE FROM queuelist WHERE requestID = 0', []);


Or by walking through each element of the queue and checking it seperately. (I'll not provide code for that because it's stupid to do it that way and it would take me at least half an hour to write)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Last edited by Mastacheata on June 10th, 2014, 5:12 pm, edited 1 time in total.
mixed up your requirements and wrote a query to remove only requests at first try. This is now fixed and the PAL code around was added


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 11th, 2014, 9:15 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
I do not know MySQL software. Well there is no way to turn off a pal when I am not here, so I don't think it's a stupid idea. it would clear the queue so the running pal would not back up its shouts, ID's etc.
Walt


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 11th, 2014, 9:53 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
You just use the before-mentioned code snippet in order to replace the queue.clear command.
It will not repeat, but only clear the queue once, leaving all requests in the queue.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 15th, 2014, 4:58 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
like I said I don't know MySQL, so I guess that's out. (wouldn't know where to start)


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 15th, 2014, 8:39 am 
Offline
Experienced User
Experienced User

Joined: March 26th, 2014, 7:47 pm
Posts: 291
Location: New Jersey
you take this line: (as stated by mastacheata)

Code:
ExecSQL('DELETE FROM queuelist WHERE requestID = 0', []);


and you put it into a pal script and then run the pal script and itll do exactly what you asked for. you don't need to know sql or anything else.

its seriously that simple

_________________
[INSERT]Signature Here[/INSERT]


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 8:18 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
Made a pal script out of it ran it but nothing happened. it runs and stops like it should but does not remove anything.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 9:20 am 
Offline
Experienced User
Experienced User

Joined: March 26th, 2014, 7:47 pm
Posts: 291
Location: New Jersey
update your pal script so it looks like this

Code:
ExecSQL('DELETE FROM queuelist WHERE requestID = 0', []);
Queue.Refresh;

_________________
[INSERT]Signature Here[/INSERT]


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 11:12 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
did what you said and I get and error. Line 2 column seven


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 1:36 pm 
Offline
Experienced User
Experienced User

Joined: March 26th, 2014, 7:47 pm
Posts: 291
Location: New Jersey
that command only works in sam 4.9.4 and newer. What version are you using?

http://spacial.com/radio-software-community/sam-broadcaster-update-4-9-4

_________________
[INSERT]Signature Here[/INSERT]


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 5:42 pm 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
I am using ver. 4.9.1 I really do welcome your help


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 16th, 2014, 6:14 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
You CAN leave the refresh command out, but the changes to the queue might not take effect immediately then. (Some point between immediate and never, which time is not set)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 17th, 2014, 5:32 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
do you know why I get the error message?


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 17th, 2014, 6:32 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7888
Location: Aachen (Germany)
Of course.
This is the very same error message you see with every command that is not implemented in PAL.
If you write Queue.DoSomethingNotImplemented; you'll see an error complaining about column 7 having a wrong command.
The first 5 columns is the identifier for the object (Queue) then comes the connecting dot and on column 7 is something that is not part of PAL.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Pal to clear Que
PostPosted: June 17th, 2014, 10:16 am 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
Then how do I get this to work on sam 4.9.1? I just want it to remove everything in the queue but the requests.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 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:  
Powered by phpBB® Forum Software © phpBB Group