A little demo package showing how to use named patterns, which allows your triggers to use matches.variablename as a capture instead of matches[#]:
Before:
After:
This is particularly handy when you have several patterns and the order of matches changes throughout them, as you can notice is the case here - attacker either comes first or second in the patterns.
Named patterns demo
Named patterns demo
- Attachments
-
- Named patterns demo.mpackage
- (1.26 KiB) Downloaded 488 times
Re: Named patterns demo
+1 for the use of f as well =)
Re: Named patterns demo
Indeed, check out the docs for this useful addition by demonnic: https://wiki.mudlet.org/w/Manual:Lua_Functions#f