Can we change the parameter delimiter?

Forum to discuss MLScript plugin that enables VBScript and JavaScript scripting within MLServer3.
bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Can we change the parameter delimiter?

Postby bigDvette » Wed Apr 02, 2008 4:21 pm

If you use setvariable or MLTimer and want to call MLScript, you can't because you can't put ~ in a variable or when building the command for MLTimer. I see all kind of uses for MLScript, but the one that has me hung right now is that I'd like to be able to call it from MLTimer, but I need parameters to make this work efficiently. A lot of the DVDLoby stuff doesn't use ~ for delimiters. Can this be a change for MLScript too?

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Postby CinemarDave » Wed Apr 02, 2008 10:38 pm

Version 3.0.482 of MLServer includes a version of MLSript that will accept ?? as delimiters instead of the traditional ~. You cannot mix ~ and ?? in one MLScript command. But either will work.

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Postby bigDvette » Thu Apr 03, 2008 8:02 am

WOOT!

Thanks Dave!

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Postby bigDvette » Thu Apr 03, 2008 10:50 pm

This has solved my issues Dave. Thanks. Of course I made the classic MLInstaller mistake and clicked install before I clicked download and it took me an hour before I realized I hadn't updated MLServer, but all is good now.

For those that want my script I have a simple 2 function script. Someone said you could actively debug, but I haven't figured out how to do that yet.

From MLLigthing, I set an event to the On condition of the lights I want to monitor like my sons room and I use the follwoing command.

MLServeCmd.MLScript|LightingTimerCommand??SetTimer??3??20??024

The first parameter is the timer number I want to set and the second is the number of minutes for the timer and the third is the light number or name (my names aren't unique). This is way easier than managing the whole command in MLLighting due to the single line edit box for the command.

When you call SetTimer it sets a MLTimer with a command to call MLScript again. I had to do this because you can't put ~ characters in the MLTimer Command, so I call MLScript and have it call MLLighting.


-------------- LIGHTINGTIMERCOMMAND SCRIPT ---------------------

Sub SetTimer (Params)

MLServer.cmdReceive "MLServeCmd.MLTimer|SetTimer~" & Params(0) & "~NoRepeat~" & Params(1) & "~minutes~MLServeCmd.MLScript|LightingTimerCommand??LightOff??" & Params(2) & "~enable"

End Sub

Sub LightOff (Params)
MLServer.cmdReceive "MLServeCmd.MLLighting|Off~" & Params(0)
End Sub


Return to “MLScript”

Who is online

Users browsing this forum: No registered users and 1 guest