• 0

    posted a message on Creating a Selection List
    you could do this with an AceConfig (not to be confused with AceGUI) and some Multiselect groups.... granted it be some strange function magic to make it work.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting AceDB data
    Are you trying to sort a dictionary or a sequentially indexed table?

    You cannot sort a Dictionary in Lua. Only indexed tables.
    Posted in: Ace3
  • 0

    posted a message on New to Lua, stumped on slash command
    if your looking for a quick addon, i wrote this a while ago & it still does work :)

    http://www.wowace.com/addons/autopartybuttons/
    Posted in: Lua Code Discussion
  • 0

    posted a message on Not sure what is Causing this visual error
    that's likely going to be a problem with Fortress
    Posted in: AddOn HELP!
  • 0

    posted a message on Need help with gsub function
    In non English locales they have a possibly of using what's called a Multi-byte Character.
    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") 


    might work
    Posted in: Lua Code Discussion
  • 0

    posted a message on not sure where i'm going wrong...
    would recommend you break your logic statements down one at a time.
    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
    Posted in: Lua Code Discussion
  • 0

    posted a message on Need help with gsub function
    btw, this prolly only will work with english clients... you'd need to use the cool fronteir pattern to make it work.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Is there a way to parse tooltips?
    Quote 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.
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to send messages to chat?
    other than you cannot send texture strings in chat messages, no
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to send messages to chat?
    SendChatMessage()

    wwwdot, have you considered joining us in IRC on freenode/#wowace
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    In your other thread you mentioned that you have a "PLAYER_LOGOUT" event running and that your setting your SV to 'true'.

    Nothing needs to be done to your SV when you logout, the client takes care of it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    Quote from wwwDot
    One 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. :/

    /edit

    But thank's for the cookie :)


    But has your understanding increased ?

    that is all that really matters :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    http://paste.wowace.com/3027/
    ----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 :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    I can sell you a cookie if you want :) i recently attempted to resolve this sort of tracking a few days ago :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    Quote from wwwDot
    So 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
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.