Page 1 of 1

Combination! ( ) trigger help

Posted: Thu Sep 18, 2014 9:06 am
by MrDude
I'm trying to take the actions given in the ( ) of the pattern line and execute them one by one, all at once. The amount of moves in the ( ) can range from 1 to 9, I believe. Usually looks like this

Combination! ( rp r lp r s s )

I want it to see that and automatically input:
right punch
roundhouse
left punch
roundhouse
sweep
sweep

Thanks for the help in advance!

Re: Combination! ( ) trigger help

Posted: Thu Oct 02, 2014 4:10 am
by Belgarath
Hope this helps:
Code: [show] | [select all] lua
-- define combo table reference
combos = {
  rp = "right punch",
  r = "roundhouse",
  lp = "left punch",
  s = "sweep",
}

-- trigger: ^Combination! \( (.+) \)$
local c = matches[2]:split(" ")
local str = ""
for i,v in ipairs(c) do
  str = str .. combos[v]
end

selectCaptureGroup(2)
replace(str)
deselect()
There might be a better way to do it, but this was off the top of my head.