Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-30-16, 12:55 PM   #1
EKE
An Aku'mai Servant
 
EKE's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 37
auto SetLootMethod

i'm trying make a addon for my guild because they almost always forget to change loot method in raid.

Code:
local frame = CreateFrame("Frame")
frame:RegisterEvent("GROUP_ROSTER_UPDATE")
local function eventHandler(self, event, ...)
    if IsInRaid() and UnitInRaid("player") and UnitIsGroupLeader("player") then
	if event == "GROUP_ROSTER_UPDATE" then
	if InGuildParty()
	then
          SetLootMethod("master", UnitName("player"))
	  print("master")
	else
	  SetLootMethod("freeforall")
	  print("free")
        end
        end
  end
end
frame:SetScript("OnEvent", eventHandler)
it can auto select loot method now, but it'll try to select every second never end

i think something wrong in code but dont know how to fix it, wrong event? which should i use?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » auto SetLootMethod


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off