CurseForge and Overwolf are joining forces!
Awesome More Information
  • 0

    posted a message on CombatText_AddMessage
    Maybe I'm missing something but I can't get this to work.
    I would like to add my own messages to Blizzards scrolling combat text but when I try to use their function I get an error. (attempt to call global CombatText_AddMessage a nil value)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Multiple lua files?
    If you create 2 lua files that contains different functions and you want to access them from eachother, do you have to make the functions global? and isn't creating global functions in general a bad idea?

    test.toc
    ## Title: test addon
    -- etc etc
    ##
    funcs1.lua
    funcs2.lua
    


    funcs1.lua
    print("funcs 1 loaded")
    function Hello()
       print("hello from func1")
    end
    


    funcs2.lua
    print("funcs 2 loaded")
    Hello()
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detect arena bracket?
    Ah ok thanks, I did some testing and got the idea of all args except "Unseen" which never fired for some reason..
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detect arena bracket?
    Nevermind, found the answer. However I got another question, is there any documentation on the event ARENA_OPPONENT_UPDATE ? I couldn't find anything on wiki.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Secure button to trigger function
    sorry for offtopic but why are you buffing healers with levitate on that fight?
    Posted in: Lua Code Discussion
  • 0

    posted a message on default party portraits
    hey, does anyone know a mod that changes the default (ugly) party portraits? It's the default portraits that shows up when your party member is not within sight.
    Posted in: Addon Ideas
  • 0

    posted a message on Sorting function help
    Quote from Farmbuyer
    Is that what you want to do?

    Yes that is what I want to do lol! Sorry for the confusion

    Quote from yssaril
    if you want to make sure that the keys of 2 tables match then you have to do the following


    Thank you! that was exactly what I was looking for ;)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    I'm comparing the keys in each table to eachother, the function actually works but I was just wondering if there's a better way to do it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    What do you guys think about this way of comparing tables? It looks a bit clunky, maybe theres a better way to do it? :cool:

    for k, v in pairs(auctionDB) do
       for k2, v2 in pairs(MyAuctions) do
          if k == k2 then
             print("found: " .. k)
          else
             print("could not find: " .. k)
          end
       end
    end
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    Oh that's nice, will try it thx!

    @Tekkub, hmm yeah that makes sense, gonna check it out!
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    Hmm another quick question, how do I get my frame to only show when AuctionFrame is visible? I tried making AuctionFrame the parent of my frame but the problem is in order for AuctionFrame to even exist it must be "seen" once (AH window opened and closed) otherwise it doesn't exist?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    works like a charm, thanks
    Posted in: Lua Code Discussion
  • 0

    posted a message on Sorting function help
    Hi I got a little prob with my addon, its an auctionhouse addon. It works pretty good except for this part, I add all the items on my auction list to a table.
    The problem is when multiple items with the same name are on the list = The function will only add the last one. What I would like to do is for the function to add the one with the lowest price..
    Anyway, it is a mess atm as you can see :D If someone could show me how to create this sorting function it would be awesome :cool:
    local MyAuctions = {}
    local MyAuctionsSorted = {}
    
    local _, total = GetNumAuctionItems("owner")
    for i = 1, total do
       local name, _, count, _, _, _, _, _, buyout, _, _, _, status = GetAuctionItemInfo("owner", i)
       if status == 0 then
          MyAuctions[name] = buyout
          for k, v in pairs(MyAuctions) do
             if k == name then
                print("found double: " .. name .. " price: " .. buyout)
                if MyAuctions[name] < buyout then
                   MyAuctionsSorted[name] = buyout
                end
                
             else
                MyAuctions[name] = buyout
             end
             
          end
          
       end
    end
    
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.