Gauge problems

Post Reply
Vonlocof
Posts: 8
Joined: Fri Feb 21, 2020 12:08 am

Gauge problems

Post 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])

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Gauge problems

Post 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.

Vonlocof
Posts: 8
Joined: Fri Feb 21, 2020 12:08 am

Re: Gauge problems

Post 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:
mudletscreenshot (1).png
mudletscreenshot2 (1).png

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Gauge problems

Post 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
Code: [show] | [select all] lua
auras = matches[8]
auras = auras:gsub("<", "\\<")
auras = auras:gsub(">", "\\>")

Vonlocof
Posts: 8
Joined: Fri Feb 21, 2020 12:08 am

Re: Gauge problems

Post by Vonlocof »

thanks for helping,

unfortunatley this didnt work :(

all it did was add a "\" to the bar instead of what was needed.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Gauge problems

Post by demonnic »

huh, try swapping them out for [] or () and see if that does it then. I would have thought escaping it would work.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Gauge problems

Post by demonnic »

may need to swap it with &lt and &gt actually now that I think on it, as those are the html variants

Vonlocof
Posts: 8
Joined: Fri Feb 21, 2020 12:08 am

Re: Gauge problems

Post 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!

Post Reply