Author Topic: EXEC command help in xLights  (Read 1126 times)

Offline jaywalk101

  • Jr. Member
  • **
  • Posts: 15
EXEC command help in xLights
« on: November 08, 2013, »
Hey everyone,

I'm trying to figure out how to call a specific .BAT file before and after specific sequences in my xLights playlist this year.  It looks like this can be done with the EXEC scripting feature within xLights.  I'm having difficulty figuring out how to do this.  Here's what I'm trying to do.  The plan is to offer my visitors a chance to control my light show from their smart phones during specific times on the show.  I basically have a dedicated computer that they will be able to connect to that will allow this.  To block/unblock their access I'm utilizing an EXPECT script that logs into my cisco switch and performs a SHUT or a NO SHUT on the interface.   I have a shut.bat and a noshut.bat file.  I basically want to call the noshut.bat (allow access) every 2 songs, and perform the shut.bat (block access) on all the other songs?   Any way I can script this within xLights?   

Hope this makes sense!  I'm almost there!!!  :)

Offline CaptainMurdoch

  • Sr. Member
  • ****
  • Posts: 180
Re: EXEC command help in xLights
« Reply #1 on: November 08, 2013, »
You are not allowed to view links. Register or Login
Hey everyone,

I'm trying to figure out how to call a specific .BAT file before and after specific sequences in my xLights playlist this year.  It looks like this can be done with the EXEC scripting feature within xLights.  I'm having difficulty figuring out how to do this.  Here's what I'm trying to do.  The plan is to offer my visitors a chance to control my light show from their smart phones during specific times on the show.  I basically have a dedicated computer that they will be able to connect to that will allow this.  To block/unblock their access I'm utilizing an EXPECT script that logs into my cisco switch and performs a SHUT or a NO SHUT on the interface.   I have a shut.bat and a noshut.bat file.  I basically want to call the noshut.bat (allow access) every 2 songs, and perform the shut.bat (block access) on all the other songs?   Any way I can script this within xLights?   

Hope this makes sense!  I'm almost there!!!  :)

Hey, me again, replying from a real computer this time instead of a cell phone.  :)

It hurts my brain to think in BASIC, but here is a simple custom script in xLights that I just created using only the 'repeat' checkbox and with a few modifications that I think will do what you want.  I haven't tested this code though.  :)  I don't know if the basic in xLights supports "sub", but if so it would make it easier rather then jumping around as this code does.  This should enable access for playlist items 1-2,5-6,9-10, and 13-14.  It should disable access for playlist items 3-4,7-8, and 11-12.  Yould go further but you'd need to move lines 201-202 or change 210 to 214 and the GOTO's that I added to point to 214 instead of 210.

100 REM *
101 REM * Created: Fri 08 Nov 2013 09:03:01 PM PST
102 REM * Random: off
103 REM * Repeat: on
104 REM * First Item Once: off
105 REM * Last Item Once: off
106 REM *
110 LET ListName$="Testing"
120 SETPLAYLIST ListName$
140 ONPLAYBACKEND 300
180 LET NextItem=1
200 REM *
201 REM * Play item NextItem
202 REM *
203 IF NextItem <= 2 THEN 351
204 IF NextItem <= 4 THEN 371
205 IF NextItem <= 6 THEN 351
206 IF NextItem <= 8 THEN 371
207 IF NextItem <= 10 THEN 351
208 IF NextItem <= 12 THEN 371
209 IF NextItem <= 14 THEN 351
210 LET LastItemPlayed=NextItem
215 PRINT "At:", FORMATDATETIME$(NOW,5)
220 PRINT "Playing:",ITEMNAME$(NextItem)
230 PLAYITEM NextItem
240 WAIT
300 REM *
301 REM * Jump here at end of song or sequence
302 REM *
307 IF TXOVERFLOWCNT = 0 THEN 310
308 PRINT "Serial transmit overflows:",TXOVERFLOWCNT
310 IF SECONDSREMAINING <= 0 THEN 400
320 LET NextItem=LastItemPlayed+1
330 IF NextItem <= PLAYLISTSIZE THEN 200
340 GOTO 180
350 REM NEW CISCO LINES 351-353 and 371-373
351 REM Calling noshut.bat to enable access
352 EXEC "c:\xlightsscripts\noshut.bat"
353 GOTO 210
371 REM Calling shut.bat to disable access
372 EXEC "c:\xlightsscripts\shut.bat"
373 GOTO 210
400 REM *
401 REM Reached scheduled end time
402 REM *
490 LIGHTSOFF


Offline jaywalk101

  • Jr. Member
  • **
  • Posts: 15
Re: EXEC command help in xLights
« Reply #2 on: November 09, 2013, »
Thanks Captain! You have come to the rescue once again!!   I appreciate all the work you have done with this and the FPP!