Go to documentation repository
Previous page Next page
Format of events procedure for the Mail Message Service:
OnEvent("MMS","_id_","_event_")
Operator format to describe actions with the Mail Message Service:
DoReact("MMS","_id_","_command_" [,"_parameters_"]);
Format of events procedure for the Mail message:
OnEvent("MAIL_MESSAGE","_id_","_event_")
Operator format to describe actions with the Mail message:
DoReact("MAIL_MESSAGE","_id_","_command_" [,"_parameters_"]);
Operator format to describe actions with the Voice Message Service:
DoReact("VMS","_id_","_command_" [,"_parameters_"]);
Operator format to describe actions with the Voice Notification Service:
DoReact("VNS","_id_","_command_" [,"_parameters_"]);
Format of events procedure for the Messenger bot:
OnEvent("TELEGRAM","_id_","_event_")
Operator format to describe actions with the Messenger bot:
DoReact("TELEGRAM","_id_","_command_" [,"_parameters_"]);
Example of using reactions of the Mail Message Service object.
Set the port number of the mail message service to 25 on Macro 1.
OnEvent("MACRO","1","RUN")
{
DoReact("MMS", "1", "SETUP", "port<25>");
}
Example of using reactions of the Mail message object.
Send message with image from camera when it switches to an alarm state when motion detection triggers.
OnInit(){
i=0; //counter is used to avoid overwriting of images from one camera
}
OnEvent("CAM",N,"REC") //camera is in alarm state
{
filename = "c:\" + N + "_msg_"+str(i)+".jpg";
i=i+1;
DoReact("MONITOR","1","EXPORT_FRAME","cam<"+ N + ">,file<" + filename+ ">");
DoReact("MAIL_MESSAGE", "1", "SETUP", "body<camera is triggered"+ N + ">, subject<alarm on camera>, from<john.smith@axxonsoft.com>, to<mary.foreman@axxonsoft.com>,attachments<" + filename + ">");
DoReact("MAIL_MESSAGE","1","SEND");
}
Example of using reactions of the Voice Message Service object:
It is required to send message on macro 1 if modem is connected to COM2 port, type of dialing is pulse, don't wait for tonal signal.
OnEvent("MACRO","1","RUN")
{
DoReact("VMS","1","SEND","modem<2>,pulse<1>,waitfordialtone<0>");
}
Examples of using events and reactions of the Voice Notification Service object:
Play the audio file when camera stops recording:
OnEvent("CAM",N,"REC_STOP")
{
DoReact("VNS","1","PLAY","file<C:\Program Files (x86)\Axxon PSIM\Wav\cam_alarm_"+N+".wav>");
}
Stop playing the audio file when the camera starts recording:
OnEvent("CAM",N,"REC")
{
DoReact("VNS","1","STOP");
}
When a predetermined time zone starts, change the volume control value to a lower one, and then after the time zone ends, set the average volume control value:
OnEvent("TIME_ZONE","1","ACTIVATE")
{
DoReact("VNS","1","SETUP","level<2>");
}
OnEvent("TIME_ZONE","1","DEACTIVATE")
{
DoReact("VNS","1","SETUP","level<8>");
}
Example of calling a command to send a message to a Messenger bot using a macro:
Call a command to send a message in Telegram using a macro.
OnEvent("MACRO","3","RUN") //run macro 3
{
//send a message using chat_id and bot_id from the object settings:
DoReact("TELEGRAM",1,"SEND","text<Hello world>");
//Explicitly specify chat_id and bot_id when sending a message:
DoReact("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>");
//Send a file with chat ID and bot ID:
DoReact("TELEGRAM",1,"SENDPHOTO","caption<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>,photo<G:\\1.jpg>");
//Send geolocation with chat ID and bot ID
DoReact("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>",longtitude<37.3428359>,latitude<55.6841654>,address<AxxonSoft>);
}