Thread: Reverse string
View Single Post
12-25-21, 03:36 PM   #1
abel8909
A Murloc Raider
Join Date: Jan 2021
Posts: 4
Reverse string

hi everyone and happy christmas eve, i'm new to this lua, could someone help me how to reverse string example
FACTION_STANDING_INCREASED = "%s %d"
for
FACTION_STANDING_INCREASED = "%d %s"

I found this code but it doesn't work

ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_FACTION_CHANGE", function(frame, event, message, ...)
local which, faction, amount = strmatch(message, "^[%+%-] (%+) (%d+) rep$")
if which and faction and amount then
return false, (format("%s%d %s rep", which, amount, faction)), ...
end
end)
  Reply With Quote