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") i think something wrong in code but dont know how to fix it, wrong event? which should i use? |
You need to check for GetLootMethod before SetLootMethod.
|
thanks, it works now:
Code:
local frame = CreateFrame("Frame") i have no idea to do that. maybe slash command to enable/disable is better way? |
You can check for normal vs instance (premade) group by passing a specifier to IsInRaid:
http://wow.gamepedia.com/API_IsInRaid However, your code will currently not work, for several reasons. Most importantly: Code:
if method ~= master or freeforall then Code:
if method ~= "master" or method ~= "freeforall" then Apart from that, some other issues / suggestions / hints:
Here's an updated version: Code:
local player = UnitName("player") |
Quote:
for my bad lua knowledge i usually forget correct logic lol so that code magically worked as a wrong way..... Quote:
Indentation was lost when i copy to thread (i delete some note when copy it). what thay need -- sloved: 1.auto select master loot in guild team. 2.auto select freeforall if not in a guild team. they are release now. ------ what thay need -- now doing: 3.need keep personal loot when sometimes make a premade group, so need a function to disable it. >do not auto select, creat a frame show option just like "wanna change loot method? [presonal] [master] [freeforall]" when leader make a group or get into a instance. >a slash cmd to enable/disable addon. form this, in fact i think they just need a Popup frame to "remind them change loot method if need". so i try another thing: make a frame to remind ppl when they get into raid. is this way correct? Code:
local f = CreateFrame("Frame") |
That will work... but it will only trigger when you either (a) move from one zone map to another or (b) enter or leave an instance. To make it trigger only when you change from "leader of a raid" to "not leader of a raid" you'd need to (a) listen for a different event and (b) keep track of which state you were in (to avoid triggering it repeatedly if the state wasn't changing). Example:
Code:
f:RegisterEvent("GROUP_ROSTER_UPDATE") ✦ When you create a frame that's visible on screen, it must be parented to the UIParent, or to something else whose parentage traces back to the UIParent. Otherwise, it will (a) not be hidden with Alt-Z and (b) won't respect the user's UI scale setting. Code:
local f = CreateFrame("Frame", nil, UIParent) ✦ If you want to be able to click on the frame, you need to turn on mouse interactivity: Code:
f:EnableMouse(true) Code:
f:SetWidth(f.Text:GetStringWidth()) Code:
f:Show() Code:
local f = CreateFrame("Frame", "LeaderLootReminder", UIParent) |
Quote:
i just thinking about a remind at first, learn a lot from this thread. |
All times are GMT -6. The time now is 11:44 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI