Author Topic: Custom Scripts in the Playlist  (Read 2378 times)

Offline bob_moodytx

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Moody Christmas
Custom Scripts in the Playlist
« on: August 23, 2016, 08:15:11 PM »
I finally have all my old LOR sequences converted over to xLights (Thank you to all the Dev's for the help)
I have 2 LOR custom features that I'm working on implementing.

The first is the Windows Command. I used the Windows Command built into LOR to run a batch script to FTP to our web site. This command would show on the web site the status of the show (ON or OFF). If the show starts then the web site shows the show is on and when the show ends it updates the site to indicate the show is OFF. This is a great feature for us considering where we live. It keeps people from making a long drive for a dark show.

The second feature was X10 control. I use a CM11a controller to turn on and off the radio transmitter. I used to have more X10 effects but they are all gone now (turning on inflatables etc)...

With that being said. I was looking at the custom script options. As long as any GOTO reference is resolved can we as the end user modify the custom script?

My Windows Command is a simply CMD file that could be incorporated and I have a command line executable that controls the X10 with simple ON and OFF commands.

If we can modify the script then I should be able to utilize all the features I had last year with LOR.

I understand that if this works it would only work when using the xLights scheduler. I know a lot are using FPP to run their shows (I would like to get there especially if there is a resolution for updating the web site (simple FTP ) and using X10. I realize that X10 probably wont be an option but I know there are X10 libraries that can be incorporated into Linux ... but that's another topic.....

Main question is the xLights Custom scripts...

thanks for the help ..

Bob
My train of thought has derailed. There were no survivors.

Offline bob_moodytx

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Moody Christmas
Re: Custom Scripts in the Playlist
« Reply #1 on: August 23, 2016, 09:27:16 PM »
Think I found my own answer .. (amazing what research does AFTER you ask a  question !!)

I added the following line ..

405 EXEC "cmd.exe /c C:\AHV\RadioOn.bat"

Now my X10 controller for my transmitter turns on/off

I haven't tested yet but I assume my batch files for the web page status update will work as well ..

My train of thought has derailed. There were no survivors.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Custom Scripts in the Playlist
« Reply #2 on: August 24, 2016, 07:14:19 AM »
You can run scripts in xLights?  Cool.

Offline greg s

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Custom Scripts in the Playlist
« Reply #3 on: September 22, 2016, 09:07:05 PM »
Bob,
Can you explain how you are doing this.  I have been learning the xlights program for a few weeks now
, Great program by the way and thanks to all the developers for their hard work.  I wanted to migrate
all my LOR sequences over to xlights however I rely on command scripts extremely heavy so for this year
I am going to use xlights to build my RGB effects to export for a LOR file.  Next year I would like
to fully migrate over.  Thanks

Greg

Offline bob_moodytx

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Moody Christmas
Re: Custom Scripts in the Playlist
« Reply #4 on: September 24, 2016, 10:36:56 AM »
Hey Greg,

What I did was to utilize the Playlist | Custom Script Option
I added lines to the custom script at the beginning:
107 EXEC "cmd.exe  /K C:\AHV\RadioOn.bat"
108 EXEC "cmd.exe  /K C:\AHV\statuson.bat"

and then again, I added lines at the end of the script:
492 EXEC "cmd.exe /K C:\AHV\RadioOff.bat"
494 EXEC "cmd.exe /K C:\AHV\statusoff.bat"


The RadioOn and RadioOff batch files are simply calling a program that I found to turn on and turn off an X10 controller that I have. My transmitter is plugged in to an X10 module and this batch file allows me to send command line controls.

The Statson and Statuoff batch files are used to update our webpage with status of the show. Basically is it on or off. Since we live so far out of town, we wanted people to know if the show was running before they made the trip.

Hope this helps.

Bob
My train of thought has derailed. There were no survivors.

Offline sean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1727
    • View Profile
    • Xlights and Nutcracker Forum
Re: Custom Scripts in the Playlist
« Reply #5 on: September 24, 2016, 08:00:02 PM »
Matt Brown added scripting into xLights back in 2011. He also has the ability to launch a video when you run a sequence. He was ahead of his time (6 years ago). We have not added any new functionality to his original scripting (it is like visual basic commands). Most everyone uses the FPP on a raspberry pi to run their show . it has way more capability but if all you need is to launch some dos commands , you are good to go.

Sean
Littleton, CO
Latest releases http://nutcracker123.com/nutcracker/releases
xLights/Nutcracker Forum http://nutcracker123.com/forum/index.php
Fbook [url=https://www.facebook.com/groups/62

Offline greg s

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Custom Scripts in the Playlist
« Reply #6 on: September 26, 2016, 09:32:56 PM »
Thanks Bob,
I may play around with it a bit but mostly likely stick with LOR for this year.  I have so much more to do that I think that will be the only way to get the show finished this year.

My scripts are a little complex as I use a telephone request program.  I got the script from a fellow user years ago and have been running it since, most people really like requesting any of the songs.  What my script does is sends the RDS to the radio transmitter, sends a few text files to an led sign, puases until about 20 seconds before the end of the song then calls a php script to read the request que and load a new show schedule.  It is a pretty slick setup.  If I can get each song to call their specific scripts I would be set.

Sean,
I have watched most of your videos great work on the program and the tutorials, I will say I downloaded nutcracker quite awhile ago but I never really latched onto it until recently.  It is one awesome program!!! You guys are doing a great job!!  Using a PI is my eventual plan but not this year.