Code: Select all
My prompt:
H:5175/5175|4854/4854 B:100% Exp:28 [kdb eb lr] 100|100 Kai:0
Pattern:
H:(\d+)/(\d+)\|(\d+)/(\d+) B:(\d+)% Exp:(\d+) \[(\w+) ([eb-]{2}) ([lr-]{2})\] (\d+)\|(\d+) Kai:(\d+)
My (intended) prompt after the trigger fires:
H:5175|4854 B:100% [kdb eb lr] Kai:0 <a_variable_value>
Code: Select all
selectCaptureGroup(3)
replace("")
selectCaptureGroup(5)
replace("")
replaceAll("/", "")
selectCaptureGroup(7)
replace("")
selectString(" Exp:",1)
replace("")
selectCaptureGroup(11)
replace("")
selectString("|",2)
replace("")
selectCaptureGroup(12)
replace("")
I wish to add some things to the prompt as well. The value of 'curebals', as well as the values of health_change and mana_change. I am not sure whether I ought to select the entire prompt line with selectString(matches[1]), move the cursor to the end and then use insert(), or to use suffix()
There seem to be multiple ways to do this (as expected), but I am not sure which way is best. the suffix() function may just be a short-cut to doing the exact same thing. So, if anyone has advice on technique, I will appreciate it very much.
Edit: I have tried suffix, but am not sure how to make it work. The following does nothing:
Code: Select all
----- Damage Change -----
if diffH ~= 0 then
selectString(matches[1])
suffix(" <" .. diffH .. ">")
end
if diffM ~= 0 then
selectString(matches[1])
suffix(" <" .. diffM .. ">")
end
Tips?