For starters take a look at the help files for GetVariable("name") and SetVariable("name",value).
Also note that you'll get errors if you try and add a blank variable to a number, so your clear script should initialise them to 0 rather than simply blank them out.
All you need do to set the addition of a variable to 1 is:
Many many thanks..this worked great...here is what i got..
__________________
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^The (.*?) attacks you with (.*?)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable("Attacks",(GetVariable("Attacks") + 1))
Note("ttl-Attacks: " .. GetVariable("Attacks"))</send>
</trigger>
</triggers>
___________________
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^(.*?), but you parry the blow with your (.*?)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable("Parries",(GetVariable("Parries") + 1))
SetVariable("Attacks",(GetVariable("Attacks") + 1))
Note("ttl-Attacks: " .. GetVariable("Attacks"))
Note("Parries: " .. GetVariable("Parries"))
Note("Percentage parried: " .. ((GetVariable("parries")/GetVariable("Attacks"))*100) .. "%")</send>
</trigger>
</triggers>
____________________-
and aliases....sc (show counter) and zc..(zero counter)
In addition to string.format() you can also use math.floor() and math.ceil() which will round the number either up or down to the nearest integer.
Example in the help file is:
Note(math.floor(5.5))
-->5
Note(math.ceil(5.5))
-->6
But to get the decimal values, yes it is best to use string.format(). The help file on that will have a few examples which should explain all the options.
There is a "round" function in that which actually rounds (math.floor and math.ceil truncate up or down, whereas round goes up or down depending on which integer it is closer to).