Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

WoWInterface » Developer Discussions » Lua/XML Help » Reverse string


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off