MLScript Plugin

From Cinemar Wiki
Jump to: navigation, search

About

MLScript is a plugin for "Power Users". It provides the means to create and execute VBScript and JavaScript scripts.

This opens many doors for all kinds of projects.


MLScript plugin provides some new organization as your scripts are viewable in a single window which can put some sanity in keeping them organized. The scripts are written to the MLScript.mdb database, so it is easy to back them up and move them from one system to another (important for dealers). The scripts aren't a bunch of individual files that loose context a few months after they are written as is the case with WSC file scripts.

The MLScripts user interface has a script description field so you can remember what each script does.

Unlike using WSC scripts, with MLScripts, you an also Stop / Start / Edit your script without having to restart MLServer. A great aid in the development and testing of a script.

Because of it's nature, support for this plugin will be nominal as most all issues will be about understanding on how to create scripts that is outside of the support scope of Cinemar. The Cinemar community is welcome to share installation tips, sharing of scripts, How To's, etc. on both this Wiki thread, as well as on the forum which will have a new thread created for it. This plugin is really intended for software developers and advanced users to use.


MLScript is now in BETA.

Here are some VBScript and JavaScript reference sources:

http://msdn2.microsoft.com/en-us/library/t0aew7h6.aspx

http://msdn2.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx

Installation

Download the plugin via MLInstaller: Here

Run the install file on the primary MLServer3 PC.


Launch MLServer3 and right click on the MLScript plugin in the Plugins window. Click Settings.

You will see two included sample scripts. The scripts are contained within the MLScripts.mdb in the Data directory.

You will note that the settings window title bar tracks the number of scripts and the number of scripts licensed. The plugin will install with default capability to manage up to 20 scripts.

MLServer Variables

MLServer Commands

Syntax:

MLServeCmd.MLScript|ScriptName for scripts that do not require parameters passed to them

or

MLServeCmd.MLScript|ScriptName~FunctionName~Parameter1~Parameter2~...ParameterN for scripts that require parameters passed to them.

Script Examples

Option Explicit

MLServer Command Reference

MLServer.cmdReceive command - allows you to send MLServeCmd's back to the server

MLServer.cmdReceiveClient command - sends MLServeCmd as a client (example: MLServer.cmdReceiveClient "ML<plugin>|<dosomething>~<parmam>~<etc>", clientname)

MLServer.cmdReceivePush command - allows you to push a MLServeCmd onto the MLServer command queue

MLServer.SetVariable variable, value - allows you to set MLServer variables

MLServer.GetVariable variable - allows you to get the value of the specified MLServer variable

MLServer.DelVariable variable, value - allows you to delete MLServer variables

MLServer.LogMLEvent sName, sEvent - allows you to add an entry in the MLServer Event Log

MLServer.doPlugin PluginName, PluginCommand, PluginParameters, ClientName


Sub MySample


dim MyServer

dim MyIPAddr

dim oShell

dim Username

dim tmpStr

Set oShell = CreateObject("WScript.Shell")

Username = oShell.ExpandEnvironmentStrings("%username%")

Set oShell = Nothing

MyServer = MLServer.GetVariable ("server_servername")

MyIPAddr = MLServer.GetVariable ("server_ipaddress")

tmpStr = "Hello " & Username & " your server name is " & MyServer & " and its IP Address is " & MyIPAddr

MLServer.SetVariable "AAATest", tmpStr

End Sub


Call MySample

Script Techniques

Code:


You can use the attached script to send an email message via a MLServer command.

Usage is MLScript|SendMsg~EMail~<<TO>>~<<SUBJECT>>~<<MESSAGE>>

You will have to have Outlook installed on your MLServer PC and also the Redemption.dll to bypass Outlook security dialog boxes. You can download redemption from here.

Redemption

Email Script

Bugs

Feature Requests