My mud sends me thisYou can see that string.find() returns the start and finish indices of the whole pattern and the captures that we made using brackets in the pattern.
A~1053 means my current health is 1053 and B~1053 means my max health is 1053A~1053~B~1053
So i'm using this code to capture.
Code: Select all
hpCur = x.value:find("A~(%w+)")
hpMax = x.value:find("B~(%w+)")
echo(hpMax) gives me 8.
I'm assuming 1 and 8 are the start indices of the pattern.
My question is how to i get it to return the captures? ie the (%w+).
Sorry if its a stupid question, been searching through all the sites but i can't find it, or i missed it.
Any help would be appreciated.
Thanks.