The Tournament Director Forums

Main => General Discussion => Topic started by: beaker on January 06, 2012, 05:38:04 PM

Title: Run Program event action
Post by: beaker on January 06, 2012, 05:38:04 PM
Corey, a big thanks for the "run program" event action; what a great feature!

I use it to trigger several things -

- launch keyboard wedge script for scanner registration
- kill registration script
- launch bust-out script
- turn table lights on at game start
- turn table lights off on breaks
etc, etc, etc.

It works great; lots of fun!

I'm only running into one small thing that I need to refine a bit. It seems that running these DOS batches are causing TD to lose it's active screen status (sorry if my terminology is wrong here). Basically after some of the batches run I will notice Itunes pop up in front of TD (for example), or some other random application that is running in the background. Or even worse, TD is still maximized and everything "appears" fine but another app is actually "active", therefore none of the hotkeys work until I click on the TD screen to restore it's active status.

To work around this problem I've been triggering another event a few seconds following the original event that runs "TD.EXE"; this effectively restores an active status. I tired to simply perform a save tournament action to accomplish this, but it didn't work. Wondering; can you think of any negative side affects that might occur from running the TD.EXE a number of times throughout the tourney as a solution?

Title: Re: Run Program event action
Post by: Corey Cooper on January 06, 2012, 10:44:01 PM
That's great to hear it's working out for you!

There are only a few (2, maybe 3) ways to launch an external program from the TD environment, and unfortunately they all involve a dang DOS/command prompt window.  If I could do away with that I would, believe me.

Let me put a note down on my to-do list to look into adding an option that would bring "focus" (the word you were looking for, I believe) back to the TD application after launching an external program.  I need to revisit that code to be sure it will work and be the right thing to do.

In the meantime, what you are doing is fine.  The software is written in such a way that you can't launch two instances at a time, and attempting to do so automatically brings the existing one into focus.  Additionally, the TD.exe program is really more of a launcher, and it specifically looks for a running instance and, if found, brings it to the foreground and gives it focus.  I don't see any drawbacks.
Title: Re: Run Program event action
Post by: E Z Aces on January 20, 2012, 07:43:46 PM
How do you get it to turn lights on and off?
Title: Re: Run Program event action
Post by: beaker on January 23, 2012, 09:16:48 PM
Hi E Z Aces,

You basically need a way to connect and control either a power outlet or a light with your computer. If you are a little bit adventurous and comfortable with electricity, you can google instructions to control a power outlet using a PC parallel port (i believe you can find the same thing for a serial or USB port also). I considered going this route but in the end decided to buy online; I got this one

This box does a good job of turning lights on and off and is very simple. I didn't even need extra software, I just send it commands using the command prompt (echo). Anyway, now that I've got this working good I'm already looking to ramp it up to be more impressive..... so I kind of wish I'd got a box with a bit more power (I know there are a few out there - with a wide range in cost), one that can support rapid on/off sequences in milliseconds so that I could make dramatic lighting events on game start, game over, bust outs, etc.... oh well it is still pretty cool as it is.

Anyway, like I said, I control the lights from the command prompt. So I just created a little batch file (.BAT) and trigger the BAT using TD.

Let me know if you have any more questions,