Variables have now been introduced in Simple Macro Maker v0.2.
The following new commands are now available in macro sequences:
<set_variable> Set a variable to a set value. [* <set_variable-name> The name of the variable. <set_variable-value> The value to set the variable to. *]
The variables' values can be referenced within the code by writing $<var_name> where <var_name> is the name of the variable. I.e. $MyVar evaluates as the value of the variable MyVar. Arithmetic expressions are now also allowed (currently only in <print> and <set_variable-value> but soon also in the <choose-if> conditions and where else it could fit).
Here's a short example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<macro>
<declarations>
<variable>
<variable-name>Counter</variable-name>
<variable-type>Integer</variable-type>
<variable-initial_value>1</variable-initial_value>
<variable-current_value>1</variable-current_value>
</variable>
</declarations>
<sequence>
<for iterations="5">
<wait base="500" random="0"/>
<print>$Counter*$Counter</print>
<set_variable>
<set_variable-name>Counter</set_variable-name>
<set_variable-value>$Counter+1</set_variable-value>
</set_variable>
</for>
</sequence>
</macro>
This code declares one variable (Counter) with the initial value 1 and then performs a loop. The loop iterates five time and each time the square of the current value of the variable Counter is printed and Counter is then increased by one.
The output is simply: 1 4 9 1625