I’m trying to figure out a way to have a macro or keybind to select Need, Greed, or Pass on the loot popup window. (Really, all I want is the Pass, but it would be nice to have all three options).
Assuming this isn’t protected, you might be able to do something like this:
/run for index, loot in ipairs(GetLootInfo()) do RollOnLoot(index, nil) end
GetLootInfo() returns a table identifying all the things you can roll on.
RollOnLoot receives 0 or nil to pass, 1 to Need, 2 to Greed, 3 to DE.
I haven’t tested it; let me know if it works!
Thank you, but it doesn’t seem to work. I just went and tested it running through RFC. It does nothing, not even an error. It looks close to what’s needed, but I don’t know enough about how it works to check.
I have tried this:
/script RollOnLoot(1, 0)
Which works for the first roll, but since that 1 value is hard coded in the macro it only works the one time. So it looks like GetLootInfo is the right thing, just not sure how to use it.
Hmm… try this?
for i=1, GetNumLootItems() do RollOnLoot(i, 0) end
Was just able to test that and it appears not to work either. No error, just no effect.
So if I understand right…
RollOnLoot(1,0) works to get rid of the first one, but neither of the loops I suggested worked. Obviously the problem is the loop logic then.
What happens if you just do
/run RollOnLoot(1,0); RollOnLoot(2,0); RollOnLoot(3,0);
Does that at least make multiple (the first three) loot all pass at once? That would at least demonstrate half the macro is correct.
(And if it fails silently when there are less than three items of loot, then forget about the loop and just leave it like that.)
Here’s my understanding and my testing. The first argument in the RollOnLoot is the RollID. This number appears to start at 1 and go up each time something is rolled on, even from different loots. So, for example, if I run a dungeon to a boss, get two greens from two different trash packs, then two blues off the boss, the greens would be RollID 1 and 2, and the two blues would be RollID 3 and 4.
I tested the one with the 3 RollOnLoots in it, and it worked as expected. It passed on the first three things that dropped, even though they were all from different creatures. It did not work on the fourth thing. Out of curiosity I opened the loot list (clicking on the “loot” word in the chat to bring up a list of rolls) counted them out, and was able to correctly determine what the next RollID was going to be. This number was not reset by reloading the UI, disbanding and reforming the party, or changing zones.
I don’t know how to tell what the current RollID is in game without resorting to just counting them by hand.
So I’ll begin by saying I was mixing up the api for a loot window (clicking on a corpse) and the greed/pass frame. I did a bit more research and found GetLootRollItemInfo(id). I think this returns nil (which is interpretted as false) if there is no loot by that type.
So you could do something like this:
myID = 0;
if (GetLootRollItemInfo(myID + 1) or IsModifierKeyDown()) then
myID = myID + 1
end
RollOnLoot(myID, 0);
This increments the number only if a loot roll with that id actually exists, or if you hold a modifier key (like shift or alt). Use the latter in case you actually needed something, and now need to skip over that ID number by button-mashing.
Be warned that myID is a global, and I put in line breaks for readability that you would have to remove when fitting this in a macro.
I haven’t actively tested it but the https://wow.gamepedia.com/START_LOOT_ROLL
event should have the rollID
local function OnEvent(self, event, rollID)
RollOnLoot(rollID, 0) -- pass
end
local f = CreateFrame("Frame")
f:RegisterEvent("START_LOOT_ROLL")
f:SetScript("OnEvent", OnEvent)
Edit: oh you want it to do it only when running a macro, well that makes it a bit more difficult
/run for i = NUM_GROUP_LOOT_FRAMES, 1, -1 do local f = _G["GroupLootFrame"..i] if f:IsShown() then RollOnLoot(f.rollID, 0) end end
Thank you! This appears to do exactly what I want it to do.