Go to documentation repository
The Clone method creates a copy of a MsgObject and Event object.
Syntax for method invocation:
function Clone() : MsgObject
There are no method arguments.
Example. When relay 1 closes, start video recording on camera 1 and close relay 2. When relay 1 opens, start video recording on camera 2 and open relay 2.
if (Event.SourceType == "GRELE" && Event.SourceId == "1")
{
var msgevent = Event.Clone();
if(Event.Action == "ON")
{
msgevent.SourceId = "2";
DoReact(msgevent);
DoReactStr("CAM","1","REC","");
DoReactStr("GRELE","2","ON","");
}
if(Event.Action == "OFF")
{
msgevent.SourceId = "2";
DoReact(msgevent);
DoReactStr("CAM","2","REC","");
DoReactStr("GRELE","2","OFF","");
}
}