Difference between revisions of "Macro use and format"

From AllStarLink Wiki
Jump to navigation Jump to search
(Created page with "==What is a 'macro'?== The purpose of a macro is to store normal command(s) to be called by direct command, or by the system scheduler. Or, even by a external script. They ca...")
 
Line 36: Line 36:
  
  
But to make a separate macro list for a specific node...
+
If you have more than one node on a given server and you want all you nodes to have the same macros then the above macro=macro is fine. But to make a separate macro list for a specific node...
  
 
'''macro=macro12345'''  - where 12345 could be your node number for clarity.
 
'''macro=macro12345'''  - where 12345 could be your node number for clarity.
Line 54: Line 54:
 
You should test them after creating them to be sure timing has no interference before you actually need to use them.
 
You should test them after creating them to be sure timing has no interference before you actually need to use them.
 
And note that use of our macro #2 might possibly also require us to create a new one to 'undo' any of our changes. Which in this case might be manually called at the end of the purposed example net.
 
And note that use of our macro #2 might possibly also require us to create a new one to 'undo' any of our changes. Which in this case might be manually called at the end of the purposed example net.
 
  
 
==Execution==
 
==Execution==

Revision as of 23:28, 3 January 2022

What is a 'macro'?

The purpose of a macro is to store normal command(s) to be called by direct command, or by the system scheduler. Or, even by a external script. They can be a series of commands to make short work of a larger task.

How to configure within a node

[node#xxx] ;assigned node number

rxchannel = SimpleUSB/usb_node# ; Rx audio/signaling channel

duplex=2

linktolink=no

controlstates=controlstates ; system control state list

scheduler=scheduler

events=events

morse=morse

macro=macro

tonemacro=tonemacro

functions=functions

phone_functions=phone_functions

link_functions=link_functions

wait_times=wait_times

telemetry=telemetry


If you have more than one node on a given server and you want all you nodes to have the same macros then the above macro=macro is fine. But to make a separate macro list for a specific node...

macro=macro12345 - where 12345 could be your node number for clarity.

And would correspond with macro later in the file as

[macro12345]

1=*81 ;Play time

2=*81 *31999 *937 P P *995# ; say time, connect node, play net announcement, pause, and turn off telemetry for net


It is likely better to use universal format of macro=macro and have it shared by all nodes. But listed here in the case you need separation. Each macro command string is on the same line separated by a space and ends the string with a # (hashtag) A "P" can be used to cause a pause of 500ms or a series of them for more. This would allow time of a script or connection to execute before the next command is issued. The system reads/executes them left to right when called. You should test them after creating them to be sure timing has no interference before you actually need to use them. And note that use of our macro #2 might possibly also require us to create a new one to 'undo' any of our changes. Which in this case might be manually called at the end of the purposed example net.

Execution

Macro's are called with a *5 (star 5) prefix and followed with the number assigned in the [macro] stanza You can also call them from the system schedular by number. Calling a macro # is the only method the scheduler supports. So if you wish to schedule with the system scheduler, you need a macro to execute it.