WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   giving loot automatically to someone (https://www.wowinterface.com/forums/showthread.php?t=58684)

Believe82 04-11-21 04:52 AM

giving loot automatically to someone
 
Hi,

Apologies if this has been covered, but I ran google and searches and couldn't find anything.
So I very new to coding in lua, and I saw that if I want to give out loot to myself I can use:

Code:

local playerName = UnitName("player")
        SetLootMethod("Master",playerName,"2")
        for ci = 1, 40 do
        local mMaster = GetMasterLootCandidate(li, ci)
            if mMaster == UnitName("player") then
                    GiveMasterLoot(li, ci)
            end
        end

I would like to pass code to the addon using either a slash command + player name or slash command + selected player, so when I am the master looter all loot would go to that player.

this is the code I tried at the end of my slash command:

Code:

elseif input == "" then
        print("NLoot: Invalid Command, Input '/nl help' to get a list of available commands")
        else
                local rString = input
                for ci = 1, 40 do
                  local mMaster = GetMasterLootCandidate(li, ci)
                  if mMaster == rString then
                      GiveMasterLoot(li, ci)
                  end
                end
        end

But it returns an error.
Is there an easier way to do this?
Thank you for the help in advance.

Rilgamon 04-11-21 06:59 AM

Wouldnt it be easier to make him masterlooter?

Believe82 04-11-21 07:12 AM

Quote:

Originally Posted by Rilgamon (Post 338855)
Wouldnt it be easier to make him masterlooter?

Not every loot goes to the person. The idea is for me or the person with the addon to be the Master looter and at the end the Raid leader only has the epic, rare loot and some other exceptions.


All times are GMT -6. The time now is 02:53 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI