------------------------------------------------------
Fizzwidget Feed-O-Matic
by Gazmik Fizzwidget
http://fizzwidget.com
gazmik@fizzwidget.com
------------------------------------------------------

As my Hunter friends can readily attest, keeping a wild pet can be a full-time job. Why, just feeding the critter when he gets hungry can throw off your routine -- you've got to rummage around in your bags, find a piece of food, make sure it's appropriate for his diet, and check your aim before tossing it to him (lest you accidentally destroy a tasty morsel). So inconvenient! Not to mention potentially dangerous... you don't want to spend so long digging through your bags that you or your pet become someone else's snack.

Never fear, Gazmik Fizzwidget is here with a new gadget to automate all your pet-food-management tasks! My incredible Feed-O-Matic features state-of-the-art nutritional analyzers to make sure your pet's hunger is satisfied with a minimum of fuss, advanced selective logic to make your pet doesn't eat anything you have another use for, and a weight optimizer to make sure the food in your bags stays well organized! You can have it automatically feed your pet when needed -- or, if you're worried about running out of food while you take a nap, you can opt to manually press the "Feed Now" button and it'll intelligently choose a food and accurately toss it to your pet. This is actually one of the first gizmos I started work on... but because I'm a perfectionist I haven't considered it ready for release until now.

------------------------------------------------------

INSTALLATION: Put this folder into your World Of Warcraft/Interface/AddOns folder and launch WoW.

USAGE:
Makes feeding your pet quick, easy, and fun:
	- Automatic feeding: Feeds your pet whenever his happiness falls below a certain level ("content" by default), automatically choosing an appropriate food. Makes sure not to try feeding your pet at times you can't (e.g. mounted, in combat, dead, flying, etc.). 
	- Manual feeding: Bind a key to "Feed Pet", and Feed-O-Matic will automatically choose an appropriate food and give it to the pet whenever you press it. 
	- Can use an emote to notify you when it's feeding your pet, with custom randomized messages. See FeedOMatic_Emotes.lua to customize them to your characters!

Helps you manage all the pet food in your inventory:
	- Keeps track of which foods your pet likes more, and prioritizes "better" foods when choosing what to feed the pet. Also remembers what foods your pet has "outgrown", and doesn't choose them in the future (unless you've switched to a pet who might have different tastes).
	- If you're on a quest to collect several of a certain item which also happens to be something your pet likes to eat, Feed-O-Matic can avoid consuming it. (Unless you're carrying more than is needed for the quest or there's nothing else for your pet to eat.) Type `/feedomatic savequest on` to enable this feature.
	- Feed-O-Matic can keep track of what foods are used by the Cooking recipes you know and avoid choosing food you'd rather cook. To enable this feature, type `/feedomatic saveforcook` followed by the difficulty color you want to save ingredients for. (For example, `/feedomatic saveforcook orange` will cause Feed-O-Matic to avoid choosing food items you're guaranteed to get a skillup from cooking; foods used in lower-level recipes won't be given special attention.)
	- If you'd prefer to save the better food (that is, those which provide a "well fed" bonus or other effect when eaten) for yourself, Feed-O-Matic can also avoid it when looking for pet food.
	- All other things being equal, Feed-O-Matic will try to pick foods from smaller stacks, making sure your food supply doesn't take up all your bag space. When your bags get close to full, Feed-O-Matic will start ignoring other criteria and always choosing the smallest stack so that you won't run out of inventory sooner.

CHAT COMMANDS:
	/feedomatic (or /fom or /feed) <command>
where <command> can be any of the following:
	`help` - Print this helplist.
	`status` - Check current settings.
	`reset` - Reset to default settings.
	`alert chat|emote|off` - Alert via chat window or emote channel when feeding.
	`on|off` - Turn automatic feeding on or off.
	`level content||happy` - Set happiness level for automatic feeding.
	`saveforcook orange|yellow|green|gray|off` - Avoid foods used in cooking recipes (based on their difficulty).
	`savequest on|off` - Avoid foods you need to collect for a quest.
	`savebonus on|off` - Avoid foods that provide a bonus efffect when consumed by a player.
	`fallback on|off` - If avoiding certain foods for one of the above reasons, fall back to such foods if no other foods are available.
	`keepopen <number>` - If you have more than *number* inventory slots open, Feed-O-Matic will prefer foods your pet likes more. If you have *number* or fewer slots left, Feed-O-Matic will always pull foods from the smallest stack (so space is freed up sooner).
	`feed` - Feed your pet (automatically finds an appropriate food).
	`feed <name>` - Feed your pet a specific food.
	`add <diet> <name>` - Add food to the list for a specific diet (meat, fish, fruit, etc).
	`remove <diet> <name>` - Remove food from the list.
	`show <diet>` - Show food list for a specific diet (or for `all`).

CAVEATS, ETC.: 
	- Feed-O-Matic has a database of many known foods, but it's not guaranteed to be comprehensive. You can use the `add`, `remove`, and `show` commands noted above to manage these lists directly. (Please drop me a line if you find a food that should be on there, or discover that something on the list shouldn't be there.) 
	- Currently, Feed-O-Matic can only update its list of which foods you know how to cook when your Cooking window is open. (So if you read a new recipe, we won't know to preserve the ingredients until you open your Cooking window again.)
	- Only works in English (for now), as its indexing of foods is based on item names.

------------------------------------------------------
VERSION HISTORY

v. 10900.2 - 2006/01/03
- Fixed a 1.9 compatibility issue. (Error message about GetBattlefieldStatus()).

v. 10900.1 - 2006/01/03
- Updated for WoW patch 1.9.
- Now localizable, with partial French and German translations now included. Many thanks to Graçi of Hyjal (EU), Jan-Paul, and other contributors to the comments thread of fizzwidget.com for helping get this up and running!
- Mostly locale-independent; now uses item link IDs to identify food instead of names. Unfortunately, Feed-O-Matic still requires one bit of locale-dependent information to work in ach language: the names of the six animal diets. Without translations for these, Feed-O-Matic can't look up foods in its list, which makes it pretty well broken. If you're not using WoW in English, French, or German, here's how you can help make it work for your language:
	- Tame a few pets of different creature families. (Minimally, a Bear or Boar will do -- they eat anything -- but taming pets of the other fifteen families will help me get more family names into the database.)
	- Use Feed-O-Matic to feed each one at least once. (Or at least type `/fom` once after taming each pet.)
	- Log out of WoW, and open your World of Warcraft -> WTF -> SavedVariables -> GFW_FeedOMatic.lua file in a text editor.
	- Copy the section that looks like `FOM_LocaleInfo = { ... }` and email it to gazmik@fizzwidget.com.
- The slash commands for adding, removing, and feeding specific foods now require an item link or the name of an item that exists in your inventory -- passing in just any old name won't work because we now index foods based on item ID.
- Includes refinements to code shared with other GFW mods.
- Knows its own version number -- it's present in startup and error messages and if you type `/fom help` or `/fom version`. Please include this version number when sending bug reports or help requests!

v. 1800.2 - 2005/10/12
- Fixed an error that could appear when viewing the tooltip for a food before having seen the TradeSkill UI in a session. (We'd been using the TradeSkillTypeColor list for standard colors; but that's not always around now that the TradeSkill UI is loaded only on demand.. now we use QuestDifficultyColor instead.)
- Updated our built-in tooltip hooking utility (GFWTooltip) to properly handle the new dynamic-load Auction UI; food tooltips should show in the Auction House again. (Why you'd go shopping for food there, I don't know... but it's good to conver all the bases.)

v. 1800.1 - 2005/10/11
- Updated for WoW patch 1.8.
- We now attempt to detect when the pet is failing to gain happiness after being auto-fed, delaying the next auto-feeding by five minutes in such circumstances. This should help with the problem where auto-feeding while in water (a situation we can't detect directly) would repeatedly feed the pet every couple seconds, consuming much food but not doing anything for the pet. Unfortunately, this may also interfere with normal auto-feeding -- our attempts to detect other conditions that prevent feeding sometimes fail, so this may cause auto-feeding to be delayed by five minutes if (for example) we end up trying to auto-feed during combat. I'm looking into solutions for the next relese.
- Fixed a nil error that could appear when sorting food.
- General improvements to utility code shared with other Fizzwidget addons (GFWUtils, GFWTable, and GFWTooltip).

v. 1700.7 - 2005/09/28
- Fixed some errors in our built-in tooltip hooking utility.

v. 1700.6 - 2005/09/27
- Forgot to include the GFWTooltip.lua file in today's earlier 1700.5 release which made use of it. Fixed.

v. 1700.5 - 2005/09/27
- Fixed a few more nil table errors.
- Introduced a new option `tooltip`, which adds a brief summary of your pet's opinion to tooltips when looking at food items. Now it's easy to go through your inventory and sell off any foods your pet has outgrown.
- Added help text for the `quality` option introduced last release.
- Won't auto-feed if the pet is under a Damage over Time effect (e.g. poison), as DOTs can break the feed effect and make the pet unhappy. (This works by doing pattern-matching on debuff effect descriptions, so if you see auto-feed still happening under a DOT, please let me know which debuff you're getting and its tooltip description.)

v. 1700.4 - 2005/09/24
- Added Night Elves' Shadowmeld ability to the list of conditions we won't auto-feed under. (Feeding breaks stealth for both you and your pet, which is relevant now that cats can learn Prowl.)
- Disabled auto-feeding while in Battlegrounds, since the (generally frequent) spirit-rez there also restores your pet to full happiness (but does so after a brief delay, during which we were trying to feed the pet).
- Improved control over the `keepopen` setting; you can now specify `off` or `none` to make Feed-O-Matic always choose foods based on quality, or `max` to make it always choose smaller stacks of food. Also clarified `status` output regarding the `keepopen` setting.
- Added `quality` command to allow reversing the normal behavior of choosing hihger-quality foods when available. (Some hunters like to ensure they're alwayes feeding their pet the best foods and thus needing to feed less often; others prefer to work from the low end so they get the random "junk" food cleared out of their inventory.)
- Prioritized mage-conjured foods so that they'll be fed to the pet before other foods (only applicable to pets that eat Bread), since it'll disappear from your inventory once you log out.
- Fixed an error that sometimes appeared when auto-feeding the pet.
- Fixed an error that sometimes appeared when opening tradeskill windows.
- Fixed an error that appeared when opening the pet stables window.

v. 1700.3 - 2005/09/21
- Previously, the `add`, `remove`, and `feed` commands only allowed item links (but this wasn't clearly documented, or intended). Now you can also type the name of an item. (If using item links, though, you can shift-click multiple foods to add, remove, or feed several at once.)
- WoW 1.7 changed the way pets gain happiness when fed, invalidating the way Feed-O-Matic tries to figure out which foods your pet likes more. Rewrote the way we look for and rank food to account for this, fixing several cases of Feed-O-Matic mistakenly claiming it couldn't find any food (including some unrelated to pet happiness).
- Added an option to control whether to fall back to foods we'd normally rather avoid if no other foods are available. This is on by default so that your pet doesn't run off on you while you're not paying attention.
- Avoiding various types of "useful" food (the `saveforcook`, `savebonus`, and `savequest` options) is now turned on by default. (The default setting for `saveforcook` is now "green").
- Fixed some cases of automatic feeding tossing the pet several foods at once. (Not that most pets would mind, but their owners might.)
- Added several more foods to the default list (and corrected some foods that were listed under the wrong diets).
- Feed-O-Matic can now detect when the pet is manually fed and use the resulting data in its food quality table.
- Supports wowguru.com's UI updater utility (and potentially others).

v. 1700.2 - 2005/09/15
- Fixed an error in a debugging statement that prevented feeding from working for some.
- A bit better about not cluttering SavedVariables with empty stuff for non-Hunters and when certain features are unused.

v. 1700.1 - 2005/09/13
- Initial release.
