- Curse Premium
Member for 14 years, 9 months, and 23 days
Last active Tue, Mar, 2 2021 09:17:42
- 0 Followers
- 3,788 Total Posts
- 0 Thanks
Dec 28, 2010In non English locales they have a possibly of using what's called a Multi-byte Character.Posted in: Lua Code Discussion
However, for my experiance i have only seen patters that detect if the first byte is a multi as in character names.
local MULTIBYTE_FIRST_CHAR = "^([\192-\255]?%a?[\128-\191]*)" -- taken from LibAlts-1.0
however you should be able to modify it by simply removing the ^ char at the beggining as that indicates the front of the string. Building off what Lombra gave:
gsub(oldName, "%s([\192-\255]?%a?[\128-\191]*)%S*", " %1")
Dec 28, 2010would recommend you break your logic statements down one at a time.Posted in: Lua Code Discussion
function LvlWizRev_BarShow() print("Barenable:", WizOptionsRev.Barenable) if WizOptionsRev.Barenable == false then print("Maxlvl:", WizOptionsRev.Maxlvl) if WizOptionsRev.Maxlvl == false then print("Hiding Frame") LvlWizRevFrame:Hide() DEFAULT_CHAT_FRAME:AddMessage(LWR_CSTR_HIDE) end else print("Showing Frame") LvlWizRevFrame:Show() end end
Dec 27, 2010Posted in: Lua Code DiscussionQuote from Xchg
if not _G then [B]--what goes here?[/B] else local _G = _G ---btw, this does nothing, as the local disappears when the if-then closes end
IIRC, unless you use the API by calling it from with in your localized _G reference, then this optimization is quite useless. Simply putting local _G = _G at the top of the file has no functional bennifit.
Dec 23, 2010In your other thread you mentioned that you have a "PLAYER_LOGOUT" event running and that your setting your SV to 'true'.Posted in: Lua Code Discussion
Nothing needs to be done to your SV when you logout, the client takes care of it.
Dec 23, 2010Posted in: Lua Code DiscussionQuote from wwwDotOne thing i don't like about asking for help lol..........
Now i can't say i did this.
And you have done it, because of me asking question's lol. :/
But thank's for the cookie :)
But has your understanding increased ?
that is all that really matters :)
Dec 23, 2010http://paste.wowace.com/3027/Posted in: Lua Code Discussion
----As this is just a pastey, copy and paste in to a file.
---- do a find and replace on ' SAVED_VARIABLE_NAME '
---- with the actual name of the saved variable in the ToC File.
Is your cookie. It accounts for things like different toons being in different guilds and even changing guilds mid session.
It also adds in using LDB. So if this particular problem with gold and events ties into your other thread about minimap buttons n' such... then this paste should solve it :)
Dec 23, 2010Posted in: Lua Code DiscussionQuote from wwwDotSo if i were to change the saved variable name to say, keepVarTot, i would have to do this?
local currentTotal = (keepVarTot or 0) + currentTotal currentTotal = (gold*1000) + (silver*100) + copper keepVarTot = currentTotal lootAmounts:SetText("You have looted " .. GetCoinTextureString( keepVarTot ) .. " for your guild bank." )
Please fix your tabbing when posting to the forum, rather interesting to read code blocks that are all over the place
ok a few ways to go about this, depending on preference and practice.
--Method 1: local currentTotal = (gold*1000) + (silver*100) + copper SavedVariable = SavedVariable + currentTotal lootAmounts:SetText( "..."..SavedVariable.."..." ) --Method2: SavedVariable = SavedVariable + (gold*1000) + (silver*100) + copper lootAmounts:SetText( "..."..SavedVariable.."..." )
the "SavedVariable" here is the actual variable in the ToC file being saved, or somewhere on a table that is being saved to said SavedVariable
- To post a comment, please login or register a new account.