1. #1
    Stood in the Fire McSpriest's Avatar
    10+ Year Old Account
    Join Date
    Aug 2011
    Location
    In a Hole
    Posts
    459

    How does a macro determine inventory slot versus bag slot

    I have a macro question I've been wondering about for those of you out there.

    how does it identify bag spot vs. inventory spot

    like for example:
    /use 1 4
    uses the fourth item in my first bag (non-backpack) or equips it if its equitable

    versus
    /use 1
    which activates my helm if it has a use (like headless horseman's hat)

    and obviously
    /use 14 activates your second trinket

    is it that space in there that identifies if its bag or inventory?
    like is the fact that there are two numbers allowing it to recognize the difference?
    just curious that's all

  2. #2
    Deleted
    I'd assume so, yes. A simple match of:
    Code:
    local input = "1 4"
    local bag,slot = input:match("(%d+) (%d+)")
    if bag and slot then
        -- do something
    else
        local inv = input:match("%d+")
        if inv then
            -- do something else
        end
    end
    (pseudo-code, obviously)

  3. #3
    Stood in the Fire McSpriest's Avatar
    10+ Year Old Account
    Join Date
    Aug 2011
    Location
    In a Hole
    Posts
    459
    cool
    i always wondered lol

    ---------- Post added 2012-03-14 at 01:47 PM ----------

    Quote Originally Posted by Treeston View Post
    I'd assume so, yes. A simple match of:
    Code:
    local input = "1 4"
    local bag,slot = input:match("(%d+) (%d+)")
    if bag and slot then
        -- do something
    else
        local inv = input:match("%d+")
        if inv then
            -- do something else
        end
    end
    (pseudo-code, obviously)
    also as a side note
    you wrote "GDKPd"?

    I love that add-on I'm part of a great GDKP run every friday on my alt your add-on rocks
    Last edited by McSpriest; 2012-03-14 at 06:47 PM.

  4. #4
    Deleted
    Quote Originally Posted by McSpriest View Post
    you wrote "GDKPd"?

    I love that add-on I'm part of a great GDKP run every friday on my alt your add-on rocks
    Yes and <3.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •