|
I wish to make an addon, that every time you open a loot window, it checks each item in the loot window to see whether it is a coin. If it's a coin, it will loot it. If else, it won't. A little bit of research got me to find these APIs;
numItems = GetNumLootItems()
isCoin = LootSlotIsCoin(slot)
LootSlot(slot)
Here is my pseudocode for the idea;
When loot frame is opened do
{
numItems = GetNumLootItems()
for counter is 0 to numItems do //counts from 0 to the amount of items in the loot window
{
isCoin = LootSlotIsCoin(counter)
if isCoin = 1 then
LootSlot(counter)
}
}
I hope that made sense. Basicly when the counter is 0 it will check slot 0 (Not sure if 0 or 1 is the first slot in the loot window) in the loot to see if it's a coin, if so, it will loot it. It then counts up until it reeches the amount of slots that are lootable, checks those and loots if they are coins etc.
I've never written an addon before, so any help, or fully making this for me, would be great. I have MSN, XFire and Skype if you wish to talk.
[edited by: Moglizorz at 9:05 PM (GMT -6) on 14 Oct 2008]
|