I'm attempting to combine two triggers using conditionals to make scripting the response easier.
The input is one of the following:
([ Admin whispers, "add 50 to stat hp for bubba" to you. ]
-or-
([ Admin whispers, "set stat hp to 50 for bubba" to you. ]
My expression needs to wildcard add/set, 50/hp, hp/50, and bubba. It works okay as is, except to get the data I have to go up to %8 with some of them empty if set is the command. How can I limit it to %1 - %4 when set is used?
^\([ (.+) whispers, "(add|set)(?(?<=add) (\d+) to stat (hp) for (.+)|(?: stat) (hp) to (\d+) for (.+))" to you. ]
Thanks to anyone who can help. :)
The input is one of the following:
([ Admin whispers, "add 50 to stat hp for bubba" to you. ]
-or-
([ Admin whispers, "set stat hp to 50 for bubba" to you. ]
My expression needs to wildcard add/set, 50/hp, hp/50, and bubba. It works okay as is, except to get the data I have to go up to %8 with some of them empty if set is the command. How can I limit it to %1 - %4 when set is used?
^\([ (.+) whispers, "(add|set)(?(?<=add) (\d+) to stat (hp) for (.+)|(?: stat) (hp) to (\d+) for (.+))" to you. ]
Thanks to anyone who can help. :)