I'm trying to make a pattern to match variations on prompts in Achaea/Lusternia. I've got it matching and even capturing values if I have all of them displayed in my prompt (health, mana, endurance, and willpower), but I want something that matches on other prompt configurations, also. Variations would include:
100h, 100m ex-
100h, 100m, 100e ex-
100h, 100m, 100w ex-
100h, 100m, 100e, 100w ex-
I know how to match them all in a singular regular expression. Since Lua doesn't implement the full syntax, I was wondering if anyone might be able to find a way to match them with Lua's pattern matching method.
Here's what I have so far:
100h, 100m ex-
100h, 100m, 100e ex-
100h, 100m, 100w ex-
100h, 100m, 100e, 100w ex-
I know how to match them all in a singular regular expression. Since Lua doesn't implement the full syntax, I was wondering if anyone might be able to find a way to match them with Lua's pattern matching method.
Here's what I have so far:
_,_,health,mana,endurance,willpower,flags = string.find(prompt, "^(%d+)h, (%d+)m, (%d+)e, (%d+)w ([cexkdb@-]+)")