Hello.
I've come across a slight problem in one of my functions. I am trying to take a string such as:
"@health/@maxhealthh, @manam"(without quotes)
and Tell/Note a coloured(depending on the amount):
"3317/3317h, 2341m"(without quotes)
My main problem is parsing out the @health, @maxhealth, and @mana, add a colour, replace it with the proper amount(which is stored in a lua variable, not a MUSHclient variable), and Tell/Note it to the output.
To my knowledge, I couldn't use a string.gsub to replace it because of the colour formatting. I was thinking of doing it character by character, but this would be firing anywhere from once every few seconds to several times per second, so a noticeable slowdown would be a problem.
If somebody could point me in the right direction on this, or tell me if I'm missing something, that would be great.
Thank you.
I've come across a slight problem in one of my functions. I am trying to take a string such as:
"@health/@maxhealthh, @manam"(without quotes)
and Tell/Note a coloured(depending on the amount):
"3317/3317h, 2341m"(without quotes)
My main problem is parsing out the @health, @maxhealth, and @mana, add a colour, replace it with the proper amount(which is stored in a lua variable, not a MUSHclient variable), and Tell/Note it to the output.
To my knowledge, I couldn't use a string.gsub to replace it because of the colour formatting. I was thinking of doing it character by character, but this would be firing anywhere from once every few seconds to several times per second, so a noticeable slowdown would be a problem.
If somebody could point me in the right direction on this, or tell me if I'm missing something, that would be great.
Thank you.