Documentation on how to use Server Scripting?

Discuss topics related to the plugins and uses for MLServer beta
Senior Member
Senior Member
Posts: 201
Joined: Fri Nov 25, 2005 1:27 pm
Location: Grosse Ile, MI

Documentation on how to use Server Scripting?

Postby tmcgowan » Sun Oct 12, 2014 7:24 am

I've been in the process of migrating all of my existing HomeSeer Events and timed activities over to ML. The last stage is to move those events that utilize VB Scripts over as well. I realize that there's going to be a lot of rework in cases, but I haven't found any detailed documentation on ML's Server Scripting function. Even having some sample scripts in the Scripting Library tab would be helpful. I've checked the Wikipedia documentation, but the only thing I could find were some cheat sheet notes from back in 2007.

Any thoughts or helpful suggestions would be appreciated!


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

Re: Documentation on how to use Server Scripting?

Postby CinemarDave » Sun Oct 12, 2014 10:44 am

There should be two sample scripts in there showing a complete example. Like the following. It's standard VBScript with a hook back to the MLServer object. Show me an example of one of your scripts and I can assist with the translation.

Code: Select all

Option Explicit

' MLServer Command Reference
'  MLServer.cmdReceive command - allows you to send MLServeCmd's back to the server
'  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", cstr(tmpStr)
   MLServer.LogMLEvent "sName", "sEvent", 0
End Sub

Call MySample

Return to “MLServer Questions & Answers”

Who is online

Users browsing this forum: No registered users and 2 guests