Nesting --> Conditionals

If you have created a unique MLServeCmd that performs a unique task, please post it here so others can learn from them.
User avatar
ewingr
Senior Member
Senior Member
Posts: 173
Joined: Tue Mar 02, 2004 6:13 pm
Contact:

Nesting --> Conditionals

Postby ewingr » Sat Apr 08, 2006 7:28 pm

I am working with trying to get a command working for plalying trailers. But, it is copmlicated by teh fact that some of them are .MOV files, and Quicktime will NOT automatically play in full screen mode. So I have a Girder command to put it in full screen mode.

But then I am wanting also check whether or not the file is to be played by TTek or Quicktime, so I know wheter to send the command to make Qucktime full screen. I know how to do all this, but my problem is figuring out how to nest the command.

Here is Pseudo code:

If <<TRAILERFILE>> exists
Play <<TRAILERFILE>>
if playing Quicktime
send MLGirder command to put Quicktim int full screen mode
else
do nothing
endif
else
Send message that there is no trialer
endif

Attempted command (which I didn'ddt expect to work):

MLServeCmd.MLConditional|FileExists##<<TRAILERFILE>>##MLServeCmd.Macro!MLFileOpen|<<TRAILERFILE>>!MLConditional|IsRunning##Apple Quicktime##MLGirder|MLCmd-QTFull## !##MLCmd|Msg~All~No Trailer File~Sorry, There is no trailer for this movie

I also tried:

MLServeCmd.Macro!MLConditional|FileExists##<<TRAILERFILE>>##MLFileOpen|<<TRAILERFILE>>!MLConditional|IsRunning##Apple Quicktime##MLGirder|MLCmd-QTFull####MLCmd|Msg~

The one above does play the movie, but it says behind MainLobby, and the final non-working command in the log file is:

MLConditional|IsRunning##Apple Quicktime##MLGirder|MLCmd-QTFull####MLCmd|Msg~

Anyone know if what I want to do is even possible? And dare to try:: :wink:

Of course, I don't expect anyone to take the time to write my command, but if it's possible to nest conditionals, help on that syntax would be great.
Thanks
Roger

User avatar
gregoryx
Simply Incredible
Simply Incredible
Posts: 6599
Joined: Tue Sep 30, 2003 10:15 pm
Location: Newport Beach, CA
Contact:

Postby gregoryx » Mon Apr 10, 2006 3:53 pm

I'm not entirely following the commands you posted, but I addressed the same thing in my command maps, which are stored here. The key that I found was to use multiple conditionals with only one command per conditional. It makes for a bunch of blank lines when things don't "match" the "IsEqual", but it allows a rather HUGE amount of conditionals.

For example, here are my "Preview" (or Trailer) commands:

Code: Select all

MLServeCmd.SetVariable|DVDTrailerFile~{{DVDPreviews}}{{DVDFileName}}\video_ts.ifo
MLServeCmd.SetVariable|DVDTrailerLocation~{{DVDPreviews}}{{DVDFileName}}

MLServeCmd.MLConditional|FileExists##{{DVDTrailerFile}}##SetVariable|DVDTrailerExists~1##SetVariable|DVDTrailerExists~0##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##SetVariable|MessageBody~Preparing to play the preview of '{{DVDMovieTitle}}'.##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##0##SetVariable|MessageBody~There is no preview available for the DVD '{{DVDMovieTitle}}'.##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##SetVariable|MessageTitle~DVD Preview
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLCmd|Msg~{{clientname}}~{{MessageTitle}}~{{MessageBody}}~60##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLFileOpen|"C:\Program Files\D-Tools\daemon.exe"~ -unmount 0

MLServeCmd.MLConditional|IsEqual##{{projector_power}}{{DVDTrailerExists}}##01##MLSlinke|projector:power##

MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLTheaterTek|EXIT
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLZoomPlayer|EXIT
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLFileOpen|"C:\Program Files\D-Tools\daemon.exe"~ -unmount 0

MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##ZOOM1##RunCmdMap|AV.Control.Zoom.Control##
MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##TT1##RunCmdMap|AV.Control.TT.Control##

MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##ZOOM1##MLFileOpen|"C:\Program Files\Zoom Player\zplayer.exe"~{{DVDTrailerFile}} /z:2 /play##
MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##TT1##MLFileOpen|"C:\Program Files\TheaterTek\TheaterTek DVD.exe"~/NOSPLASH /MON 2 /AP 2 /PATH "{{DVDTrailerLocation}}"##

MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLPause|15##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##RunCmdMap|AV.Control.{{DVDControl}}.Play##

MLServeCmd.MLConditional|IsEqual##{{projector_power}}{{DVDTrailerExists}}##01##SetVariable|projector_power~1##

MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLSlinke|projector:input1##
MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLR1066|IR~Video4##
MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##TT1##SetVariable|AVMainSourceName~HTPC Theater Tek##
MLServeCmd.MLConditional|IsEqual##{{DVDHTPCPlayer}}{{DVDTrailerExists}}##ZOOM1##SetVariable|AVMainSourceName~HTPC Zoom Player##

MLServeCmd.MLConditional|IsEqual##{{DVDTrailerExists}}##1##MLCmd|Msg~ALL~DVD Preview~The preview of '{{DVDMovieTitle}}' is starting now playing through the {{DVDControlName}}.~60##

User avatar
ewingr
Senior Member
Senior Member
Posts: 173
Joined: Tue Mar 02, 2004 6:13 pm
Contact:

Thanks...

Postby ewingr » Thu Apr 13, 2006 12:34 pm

I will study your commands and see what I can figure out. It's been a bit since I've programmed this stuff.

I appreciate your reply. I will post back with my success, or further questions.

Regards

[EDIT]
:shock: got pretty deep for me pretty fast. I need to search and find info on how to use command maps. I'll browse around and see if I can come up with more info on that before I ask ask any questions. I've tried to go into the Support area of Cinemar.com, and click on the Cheat Sheet, and ever since the first posting of this message and now it just brings up a message that says "Sorry but this board is currently unavailable. Please try again later".

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Postby DavidL » Thu Apr 13, 2006 1:10 pm

ewingr,
Sorry there is an outdated link on that Support page. I will try to remember to fix that tonight.
Here is the correct link:
http://www.cinemaronlineforums.com/foru ... 34&start=0

User avatar
ewingr
Senior Member
Senior Member
Posts: 173
Joined: Tue Mar 02, 2004 6:13 pm
Contact:

Postby ewingr » Thu Apr 13, 2006 1:15 pm

Thanks!

In fact, I browsed this forum and found the 'sticky' cheat sheet. I presume it is the same as would be pointed to on the broken link to be fixed.

It is much more complete that when I first set up my system!

I do not see anything in it about command MAPs. So, I need to browse more on that.

However, I do see how to nest in conditionals, or probably a better way to describe it, is to use the macro command within the conditionals. I think that will solve this problem.

I am interested in understanding the command maps. I am all of a sudden interested in doing a Phase 2 / Expansion of capabilities of my system through MainLobby.
Thanks
Roger

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Postby mcascio » Thu Apr 13, 2006 1:16 pm

Smoothtlk & ewingr,

Link has now been fixed on our support page.
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Postby MurrayW » Thu Apr 13, 2006 3:15 pm

Roger,

You might want to check out this thread. Some people have found the excel tool handy in developing command maps.
http://www.cinemaronlineforums.com/forum/viewtopic.php?t=5961&highlight=

There is what I hope is the final workbook in testing right now that if everything works well, I will post in the next week or so. Look on page 4 or 5 of that thread for the current file.

Good luck.

Murray

User avatar
ewingr
Senior Member
Senior Member
Posts: 173
Joined: Tue Mar 02, 2004 6:13 pm
Contact:

Command map?

Postby ewingr » Fri Apr 14, 2006 12:15 pm

Thanks I'll find it and download.

In the meantim, is there anything that tells what a command map is, and how to use it? Looking in the MLCommands chedat sheet, I see reference to command maps, but no oexplanation of how to use, What I see, it looks like maybe you list commands in a batch file, and call that file.
Thanks
Roger

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Command map?

Postby MurrayW » Fri Apr 14, 2006 5:07 pm

ewingr wrote:Thanks I'll find it and download.

In the meantim, is there anything that tells what a command map is, and how to use it? Looking in the MLCommands chedat sheet, I see reference to command maps, but no oexplanation of how to use, What I see, it looks like maybe you list commands in a batch file, and call that file.
A command map is kind of like a shortcut name for 1 or theoretically 100's of commands in sequence. So in the example code that gregoryx gave a few posts up that contains ~30 individual commands, you could name that sequence of commands Trailer and then in the MLServeCmd line of a button, not have to list all 30 commands -- you would just put MLServeCmd.Macro|Trailer in the button.

I use command maps almost exclusively for all my commands -- even if it is only 1 simple command that I am putting in a button.

Good luck.

Murray

User avatar
ewingr
Senior Member
Senior Member
Posts: 173
Joined: Tue Mar 02, 2004 6:13 pm
Contact:

Postby ewingr » Wed May 10, 2006 4:48 pm

Been away from it for a bit...

MurrayW. That's cool. Possibly one more thing to direct me: where is that list of commands stored and named? I see an analogy of calling a batch file.
Thanks
Roger

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Postby MurrayW » Wed May 10, 2006 11:21 pm

ewingr wrote:Been away from it for a bit...

MurrayW. That's cool. Possibly one more thing to direct me: where is that list of commands stored and named? I see an analogy of calling a batch file.
Open MLServer, choose Utilities then Map Commands. Or use excel to develop and manage your commands : http://www.cinemaronlineforums.com/forum/viewtopic.php?t=7003 :wink:

Good luck!
Murray


Return to “MLServeCmd Examples”

Who is online

Users browsing this forum: No registered users and 1 guest