Page 1 of 1
Gauge problems
Posted: Fri Feb 21, 2020 12:50 am
by Vonlocof
Hi,
Im trying to capture this line from my mud.
HP: 650/650 SP: 519/600 EXP: 11,487,918 DAM: 0 (Grace: 189) <holiness>
my goal is to have most of this show up in my gauges, I can get everything to work but the "<holiness>" is giving me troubles, I can capture it but I can't get it to print to the gauge, (Grace:#) works fine.
so basically I want it to pick up all buffs after the dmg and place them in one of the gauges and just need to know how to work around the "<>" symbols have been trying for hours, its probably simple.
HP: (\d+)/(\d+) SP: (\d+)/(\d+) EXP: (.*) DAM: (\d+) (.*)
auras = (matches[8])
Re: Gauge problems
Posted: Fri Feb 21, 2020 5:17 am
by demonnic
At a glance it seems like that would set auras equal to "<holiness>" . Are you just asking how to strip that out? <(.*)> will capture what's between the < and >
If that's not what you're asking, I'm not entirely sure what you're trying to work around.
Re: Gauge problems
Posted: Fri Feb 21, 2020 6:17 am
by Vonlocof
sorry for not explaining properly.
so basically my prompt looks like this:-
HP: 550/550 SP: 400/400 EXP: 4,147,918 DAM: 0
If I were to buff myself it may look something like this:-
HP: 550/550 SP: 400/400 EXP: 4,147,918 DAM: 0 (Grace) (Shelter) <Holiness> (showing what buffs I have applied)
my ultimate goal is to remove the prompt and have it run through gauges to which I have successfully done, anything that is a buff or after the damaged line no matter what it is will show up correctly in the gauge except for any buffs that are surrounded by the "<>" symbols. I can see in debugging that it is captured "capture group #8 = <(Grace) (Shelter) <Holiness>>" but when it comes to applying on the gauge the only text that comes through are the 'Grace and Shelter' buffs. I am just trying to work out why it is not displaying <holiness>.
Screenshot:
Re: Gauge problems
Posted: Fri Feb 21, 2020 6:30 am
by demonnic
Oooooh! It's because when you echo to labels it is html, and I think it's trying to interpret the <holiness> as an html tag. You can use gsub to escape it
auras = matches[8]
auras = auras:gsub("<", "\\<")
auras = auras:gsub(">", "\\>")
Re: Gauge problems
Posted: Fri Feb 21, 2020 7:40 am
by Vonlocof
thanks for helping,
unfortunatley this didnt work
all it did was add a "\" to the bar instead of what was needed.
Re: Gauge problems
Posted: Fri Feb 21, 2020 2:00 pm
by demonnic
huh, try swapping them out for [] or () and see if that does it then. I would have thought escaping it would work.
Re: Gauge problems
Posted: Fri Feb 21, 2020 2:01 pm
by demonnic
may need to swap it with < and > actually now that I think on it, as those are the html variants
Re: Gauge problems
Posted: Fri Feb 21, 2020 2:03 pm
by Vonlocof
worked it out while waiting... yeah didnt like the escape so I just changed the escape to some brackets and now it works great! thanks for the help!