Difference between revisions of "SkibUserMacros:Keywords for the algorithms of User Macros"
From Protoi Healing
(4 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
| | | | ||
|This uses the specified database in the macro. If a database don't exist, the first macro run will create it. This is very useful for macros which work with many data, so that new scans are not needed and updates are much faster. | |This uses the specified database in the macro. If a database don't exist, the first macro run will create it. This is very useful for macros which work with many data, so that new scans are not needed and updates are much faster. | ||
+ | |- | ||
+ | |style="vertical-align:top; "|'''DEFINITION''' | ||
+ | | | ||
+ | | | ||
|- | |- | ||
|style="vertical-align:top; "|'''EXIT''' | |style="vertical-align:top; "|'''EXIT''' | ||
| | | | ||
|It will stop the execution of the UserMacro immediately. | |It will stop the execution of the UserMacro immediately. | ||
+ | |- | ||
+ | |style="vertical-align:top; "|'''FOR <condition>, DO:''' | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="vertical-align:top; "|'''FOR-END''' | ||
+ | | | ||
+ | | | ||
|- | |- | ||
|style="vertical-align:top; "|'''IF <condition>, DO:''' | |style="vertical-align:top; "|'''IF <condition>, DO:''' | ||
Line 63: | Line 75: | ||
|style="vertical-align:top; "|<number><br/>{once} | |style="vertical-align:top; "|<number><br/>{once} | ||
|Starts the thread <number> at the given position in the main program. If you give the option {once}, it will start the thread only one time, for example in a loop. Without {once} it will start an additional thread in each loop. | |Starts the thread <number> at the given position in the main program. If you give the option {once}, it will start the thread only one time, for example in a loop. Without {once} it will start an additional thread in each loop. | ||
+ | |- | ||
+ | |style="vertical-align:top; "|'''THREAD-STOP''' | ||
+ | |style="vertical-align:top; "|<number> | ||
+ | |Stops the thread <number> immediately. | ||
|- | |- | ||
|style="vertical-align:top; "|'''TRY''' | |style="vertical-align:top; "|'''TRY''' |
Latest revision as of 15:48, 9 February 2017
Keyword | Parameters | Description |
---|---|---|
BREAK | Gets out of the current structure level. For example if you are in a LOOP, it will stop and leave the LOOP immediately and continue with the algorithm after the LOOP. | |
DATABASE | This uses the specified database in the macro. If a database don't exist, the first macro run will create it. This is very useful for macros which work with many data, so that new scans are not needed and updates are much faster. | |
DEFINITION | ||
EXIT | It will stop the execution of the UserMacro immediately. | |
FOR <condition>, DO: | ||
FOR-END | ||
IF <condition>, DO: | Starts a conditional structure. | |
IF-ELSE DO: | ||
IF-END | ||
LOOP <condition> | <number> <T:xx> |
This loops until the <condition> is TRUE, or if a <number> is given (written as e.g. "<30>"), it loops 30 times. If you give a <T:xx> parameter, you can set a loop time. E.g. <T:30minutes> will repeat the loop ones each 30 minutes. |
LOOP-END | ||
MONITOR | This orders the Skib to install some monitoring for a topic. This means, that some other AI(s) will get the order from Skib to 24/7 (or a given time) monitor a topic, and to send a signal, if some of the defined conditions take place. So this means, that Skib gets always an impulse to start the defined action, whenever it occurs. This may be with seconds in between, but also hours, days or more. Skib will always only have work with it, if something happens, that match the defined conditions. | |
MONITOR-END | ||
SUBMACRO-START | 'Name of SubMacro' {params} |
|
SUBMACRO-STOP | 'Name of SubMacro' | |
THREAD | <number> | This creates parallel threads in the macro. Each thread gets an ID number, e.g <1> for the first one, <2> for the second. The main part of the algorithm is always declared as thread <0>. So the beginning of a thread in the algorithm just defines the point in time when the thread will start. The threads will always run parallel to the main algorithm, if some exists. |
THREAD-END | ||
THREAD-START | <number> {once} |
Starts the thread <number> at the given position in the main program. If you give the option {once}, it will start the thread only one time, for example in a loop. Without {once} it will start an additional thread in each loop. |
THREAD-STOP | <number> | Stops the thread <number> immediately. |
TRY | Skib will try to do whatever follows this TRY. Skib will continue the execution of the algorithm independent of the success. | |
TRY-ERROR | If the belonging earlier TRY was not successful, Skib will execute whatever follows TRY-ERROR. If this is done and not order to finish the algorithm is given, Skib will continue the algorithm at next order. |
If you have ideas for more KEYWORDS, please add them on the discussion page!