• 0

    posted a message on Table into table, how to concat?
    Quote from Xinhuan
    I think your definition of "concat" isn't what the rest of us think it is.

    "Concat" in Lua means to take several strings and combine them into a single larger string, and the concatenation operator in Lua is 2 dots: ..

    Your question is extremely vague, you did not mention whether you want to concat string keys, string values or keys and values or whatever, nor what you want your result to be.


    Yes, I have understood.
    Posted in: AddOn HELP!
  • 0

    posted a message on Create whisper history
    Quote from Xinhuan
    Please read this page regarding concatenation: http://www.lua.org/pil/3.4.html

    It appears you are confusing us with your usage of the word "concat" and we don't really know what you mean. You can't concat a table, but you can concat multiple strings in a table into a longer string with table.concat().

    Please read this page regarding how to use tables in Lua: http://www.lua.org/pil/2.5.html

    In fact read the whole http://www.lua.org/pil/index.html


    Thanks, now it's clear. Then, I must to use something like this:

    commontbl = {}
    y = "Sender"
    commontbl[y] = "Message 1 from Sender"
    for k, v in pairs(commontbl) do
          print(v)
    end
    


    Now, if I want to add other strings under commontbl[y] ?
    Like this:

    commontbl[y] = {
             "Message 1" = "Text message",
             "Message 2" = "Text message"
                           }


    Is it possible?
    Posted in: AddOn HELP!
  • 0

    posted a message on Create whisper history
    My idea is this, when I recive a whisper message the addon will create an empty table named "tbl" & the name sender (and this is one problem), then, I save this in a common table (in ##Saved Variables:) and then for accessing it simply concat common table until get the right table.

    commontbl = {} -- saved with saved variables
    function FW:CHAT_MSG_WHISPER(eventName, args)  --and of curse the same for CHAT_MSG_WHISPER_INFORM event
    for _, v in pairs(commontbl) do
         if not (v==tbl..sender) then  --this is the problem, I can't create the table named "tbl"..sender
              tbl..sender = {}  --create empty table
         end
    end
    
    table.insert(tbl..sender, message)  --I will rielaborate the message with a string.gsub for the complete info (sender, date, message, ...)
    table.insert(commontbl, tbl..sender)
    end


    This is the code :)
    Sorry about all threads, I'm new in wow programming :)
    Posted in: AddOn HELP!
  • 0

    posted a message on Create whisper history
    Hi,
    after trying to create a whisper history using table into table (that doesn't work), I ask if someone can help me creating whisper history.

    Thanks
    Posted in: AddOn HELP!
  • 0

    posted a message on Table into table, how to concat?
    Okay, I resolved.

    for _, v in pairs(tbl) do
        for i, z in pairs(v) do
             print(i)  -- = Value X
             print(z) -- = Yes, yesno, ..
    end
    end
    Posted in: AddOn HELP!
  • 0

    posted a message on Table into table, how to concat?
    Quote from OrionShock
    If your looking to put the key values togeather in one string, then this should work :

    local out = ""
    for _, v in pairs(tbl) do
        for i, _ in pairs(v) do
            out = out..i
        end
    end
    print(out)
    


    I want to concat a lot of strings.
    tbl = {
        ["Test"] = {
                       ["Value 1"] = "Yes",
                       ["Value 2"] = "No",
                       ["Value 3"] = "Yes&No",
                       ...
                       }
    }


    I want to concat value 1, then value 2, ...
    Posted in: AddOn HELP!
  • 0

    posted a message on Table into table, how to concat?
    Hi,
    I have a problem. How I can concat a table that is into another table?
    Like this:
    tbl = {
        ["Test"] = {
                       ["Value 1"] = "Yes"
                       }
    }


    I want to concat the "Value 1" for get "Yes", how I can do that?
    I want to do this for create whisper history and some other things.

    Thanks in advance!
    Posted in: AddOn HELP!
  • 0

    posted a message on ScrollingMessageFrame:SetInsertMode
    Hi all,
    I'm trying to use the following code for insert messages at the top of the scrolling message frame and not at the bottom, but doesn't work.
    ScrollingMessageFrame:SetInsertMode("TOP")


    It return an error:
    [String: ScrollingMessageFrame:SetInsertMode("TOP"):1:] Usage: ScrollingMessageFrame:SetInsertMode("TOP" or "BOTTOM")


    Any help?

    Thanks!
    Posted in: AddOn HELP!
  • 0

    posted a message on Get guild memebrs's list


    Ah okay, but, if I want to create a frame with the stored data of the guild bank?
    Posted in: AddOn HELP!
  • 0

    posted a message on Get guild memebrs's list
    Other question, how to save GuildBank data in a tbl (that will be a ##Saved Variables: )?
    Store all info as possible, want to callback later, for creating a frame with your Gbank items everywhere.
    Posted in: AddOn HELP!
  • 0

    posted a message on Get guild memebrs's list
    Quote from Phanx
    Pretty self explanatory...

    for index = 1, GetNumGuildMembers() do
         local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(index)
         -- do whatever here
    end
    


    If you want more specific help, you'll have to be more specific about what you're trying to do, and show the code you're working with.


    This is what I want. Thanks :)
    Posted in: AddOn HELP!
  • 0

    posted a message on Get guild memebrs's list


    Yes, but a snippet source? I tried sometimes, but don't work.
    Posted in: AddOn HELP!
  • 0

    posted a message on Get guild memebrs's list
    Hi,
    anyone have the source for this?
    I don't know how to get it.

    Thanks

    P.s.: If possible, get |Hplayer:<name>|h and level and info (like the old addon
    Fubar - GuildFu that made a list with all info about).
    Posted in: AddOn HELP!
  • 0

    posted a message on Addon Comunications (global)
    Quote from egingell
    I hate when people do that. Also, someone might have a better solution.


    Right, then:

    local user,_ = UnitName("player") -- Get user name
    local userguild,_,_ = GetGuildInfo("player") -- Get userpassword
    if userguild == nil then -- Check if have a guild
    userguild = "NoGuild"
    end
    
    function Strip(userguild) -- Remove all crap simbols (like éç°§*é, ecc) from guild name for create channel
      return string.gsub(userguild, "%W", "2")
    end
    
    function Join()
    JoinTemporaryChannel(Strip(userguild), "password", ChatFrame5:GetID(), 0)
    ChanIndex = GetChannelName(Strip(userguild))
    end
    
    -- Below here, attach to the event CHAT_MSG_CHANNEL a function for get msg & sender
    Posted in: AddOn HELP!
  • 0

    posted a message on Addon Comunications (global)
    Resolved
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.