|
I'm trying to write an addon for myself. Having read Hello World tutorials and prior programming experience, I think I'm up for the task of writing this rather seemingly-simple addon.
The addon I want is to pop up a dialog to notify me when I receive (via World Drop) a predefined list of items/patterns/plans. The idea is that if by chance I get a twink item and have no need/desire for it, I would like to make the appropriate amount of money off my fortune rather than be the fool who sells a 30g item for 2g on the AH.
Future expansion might be to allow the user to add to that list while still in game (like Junk Sellers allow you to add items to automatically sell).
Anyway, here is some psudeo-code of what I think I need to do to accomplish this:
On Load
If FirstTimeRunningAddon = True Then SearchBags() End If
End
On NewItemInBag
IsItemATwink = CompareItems(NewItem) If IsItemATwink = True Then TwinkItemFrame.Hidden = False PlaySound End If
End
OnRemovalofItemFromBag
IsItemATwink = CompareItems(NewItem) If IsItemATwink = True Then If SellingToVendor OR DestroyingItem OR DisenchantingItem Then Remind User Item Is Twink ElseIf SellingOnAuctionHouse Then Remind User Item is Twink, Don't Sell Cheaply Else Throw Error--How did we get here? End If End If
End
SearchBags()
For Each Bag For Each Item IsItemATwink = CompareItems(CurrentBag,CurrentItem) If IsItemATwink = True Then TwinkItemFrame.Hidden = False PlaySound End If Next Item Next Bag
End
CompareItems(Item)
CompareItems = False
For Each KnownTwinkItem If Item = KnownTwinkItem Then CompareItems = True Return End If Next KnownTwinkItem
End
Any ideas how to accomplish this?
[edited by: highflight1985 at 6:40 PM (GMT -6) on 14 May 2009]
|