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 Quote:
|
Specific to the WoW API, string.format() lets you specify which args go where by modifying the format specifier. By default, they are left-to-right in order. This would flip the order by specifying the second argument goes in the first slot and vice versa. Blizzard did this specifically to support localization.
Code:
FACTION_STANDING_INCREASED = "%2$d %1$s" |
Quote:
how can I filter chat texts (from battleground) to replace them example Babe claims the stables! If left unchallenged, the Alliance will control it in 1 minute! for Babe claims the stables! this is the event |
Lua Code:
|
Quote:
Lua Code:
|
The gsub function accepts three arguments: the string, what to look for, and what to substitute.
msg=gsub(msg,find,replace) or msg=msg:gsub(find,replace) This means that replace being an empty string, "", you are deleting what the function finds. Lua Code:
The above code only filters the blue text. To alter the red text, you need to filter the Horde event. Lua Code:
If I got the colors wrong, I apologize. The messages above may all be blue, it's been a long time since I played battlegrounds. Edit: Now that I think about it, you don't have to worry about the different events if you just filter all of them at once. Lua Code:
This takes one filter function and applies it to all three BG announcement events. |
oh i see, thank you very much
|
All times are GMT -6. The time now is 02:57 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI