MLConditional Plugin

From Cinemar Wiki
Jump to: navigation, search

Plugin About

This plug-in allows you to execute conditional statements from MLServer.


Plugin Syntax

MLConditional|<<command>>##<<parm>>##<<execute_true>>##<<execute_false>>


Effective with MLServer 3.75.70, MLServer supports up to 4 nested macros. Use them this way:

Macro|MLConditional|IsEqual##Something##1##Macro|Setvariable|Var1~1!SetVariable|Var2~2##Macro|Setvariable|Var1~3!SetVariable|Var2~4##!!SetVariable|AllDone~1

In order to use this feature all you have to do is modify the macro delimiter on each nested level. The innermost macro will use a single ! as the delimiter. The next layer out will use !! as the delimiter, the next outer layer will use !!!. Macros can be nested up to 4 levels deep with this version.


Supported Commands

IsRunning

Checks to see if a window is open on the system

Example: MLConditional|IsRunning##Zoom Player##MLFileOpen|notepad.exe##MLFileOpen|calc.exe


FileExists

Checks to see if a file exists

Example:

MLConditional|FileExists##C:\autoexec.bat##MLFileOpen|C:\autoexec.bat##MLFileOpen|C:\notautoexec.bat


IsEqual

Checks to see if two values are equal

Example:

MLConditional|IsEqual##yes##no##MLFileOpen|notepad.exe##MLFileOpen|calc.exe

If variable mlcallerid_speak equals "Yes", then MLSpeak says the caller's name. If "No", then it speaks nothing (if not desired). MLServeCmd.MLConditional|IsEqual##{{mlcallerid_speak}}##Yes##MLSpeak|<<NAME>> is calling on the phone##MLSpeak|


IsLT

Checks to see if value A is less than value B


IsLTE

Checks to see if value A is less than or equal to value B


IsGT

Checks to see if value A is greater than value B


IsGTE

Checks to see if value A is greater than or equal to value B


IsNE

Checks to see if value A is not equal to value B

Nest multiple MLConditionals by using unique delimiter pairs (##, @@, %%, etc.) in each nested Conditional.


Examples of Use

Basic Conditional Examples

MLServeCmd.MLConditional|IsRunning::Zoom Player::|MLFileOpen|notepad.exe::MLFileOpen|calc.exe

If Zoom Player application is running, Notepad.exe will open, otherwise calc.exe will


MLServeCmd.MLConditional|IsEqual##<nowiki>{{Location}}##on##MLServeCmd.MLCmd|Msg~XPPro~ON~ON##MLServeCmd.MLCmd|Msg~XPPro~Off~Off</nowiki>


MLConditional|IsEqual##value1##value2##true##false