First version

This commit is contained in:
DuvelCorp
2026-02-24 23:00:59 +01:00
commit ee8328e903
125 changed files with 140652 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Binding name="FEEDOMATIC" header="FEEDOMATIC">
FOM_Feed();
</Binding>
</Ui>
File diff suppressed because it is too large Load Diff
+86
View File
@@ -0,0 +1,86 @@
FOM_Emotes = {
["any"] = {
"Yum!",
"Mmm, good stuff.",
},
["male"] = {
"Good boy!",
},
["female"] = {
"Good girl!",
},
["Zesty Clam Meat"] = {
"Mmm, zesty!",
},
["Heaven Peach"] = {
"Movin' to the country...",
},
["Mystery Meat"] = {
"Tastes like chicken.",
},
["Dragonbreath Chili"] = {
"Yow, spicy!",
},
["Bat"] = {
"Squeak-squeak snack attack!",
},
["Bear"] = {
"One paw for me, one paw for the bear.",
},
["Boar"] = {
"Good piggy!"
},
["Carrion Bird"] = {
"A gourmet meal... by scavenger standards.",
},
["Cat"] = {
"Nice kitty!",
},
["Crab"] = {
"Crabby no more!",
},
["Crocolisk"] = {
"Easy there, chompy friend.",
},
["Gorilla"] = {
"Big buddy deserves a big bite.",
},
["Hyena"] = {
"Good dog!",
},
["Owl"] = {
"Whoo's a hungry hunter helper?",
},
["Raptor"] = {
"Tiny arms, huge appetite.",
},
["Scorpid"] = {
"No stinging the cook, deal?",
},
["Spider"] = {
"Eight legs, zero table manners.",
},
["Tallstrider"] = {
"Long neck, longer lunch break.",
},
["Turtle"] = {
"Slow and steady wins the snacks.",
},
["Wind Serpent"] = {
"Lightning in the sky, snacks on the ground.",
},
["Wolf"] = {
"Good dog!",
},
["Foxes"] = {
"Clever fox, clever snack choice.",
},
["Serpents (Cobra)"] = {
"No hissing with your mouth full.",
},
};
+238
View File
@@ -0,0 +1,238 @@
FOM_Foods = {
[FOM_DIET_FUNGUS] = {
4607, -- Delicious Cave Mold
8948, -- Dried King Bolete
4604, -- Forest Mushroom Cap
4608, -- Raw Black Truffle
4605, -- Red-speckled Mushroom
3448, -- Senggin Root
4606, -- Spongy Morel
},
[FOM_DIET_FISH] = {
13889, -- Raw Whitescale Salmon
19996, -- Harvest Fish
13933, -- Lobster Stew
13888, -- Darkclaw Lobster
13935, -- Baked Salmon
13546, -- Bloodbelly Fish
6290, -- Brilliant Smallfish
4593, -- Bristle Whisker Catfish
5503, -- Clam Meat
16971, -- Clamlette Surprise
2682, -- Cooked Crab Claw
13927, -- Cooked Glossy Mightfish
2675, -- Crawler Claw
13930, -- Filet of Redgill
5476, -- Fillet of Frenzy
4655, -- Giant Clam Meat
6038, -- Giant Clam Scorcho
13928, -- Grilled Squid
13929, -- Hot Smoked Bass
13893, -- Large Raw Mightfish
4592, -- Longjaw Mud Snapper
8364, -- Mithril Head Trout
13932, -- Poached Sunscale Salmon
5095, -- Rainbow Fin Albacore
6291, -- Raw Brilliant Smallfish
6308, -- Raw Bristle Whisker Catfish
13754, -- Raw Glossy Mightfish
6317, -- Raw Loch Frenzy
6289, -- Raw Longjaw Mud Snapper
8365, -- Raw Mithril Head Trout
6361, -- Raw Rainbow Fin Albacore
13758, -- Raw Redgill
6362, -- Raw Rockscale Cod
6303, -- Raw Slitherskin Mackerel
8959, -- Raw Spinefin Halibut
4603, -- Raw Spotted Yellowtail
13756, -- Raw Summer Bass
13760, -- Raw Sunscale Salmon
4594, -- Rockscale Cod
787, -- Slitherskin Mackerel
5468, -- Soft Frenzy Flesh
15924, -- Soft-shelled Clam Meat
12216, -- Spiced Chili Crab
8957, -- Spinefin Halibut
6887, -- Spotted Yellowtail
5504, -- Tangy Clam Meat
12206, -- Tender Crab Meat
13755, -- Winter Squid
7974, -- Zesty Clam Meat
},
[FOM_DIET_MEAT] = {
21235, -- Winter Veil Roast
19995, -- Harvest Boar
4457, -- Barbecued Buzzard Wing
3173, -- Bear Meat
2888, -- Beer Basted Boar Ribs
3730, -- Big Bear Meat
3726, -- Big Bear Steak
3220, -- Blood Sausage
2677, -- Boar Ribs
3404, -- Buzzard Wing
12213, -- Carrion Surprise
2679, -- Charred Wolf Meat
769, -- Chunk of Boar Meat
2673, -- Coyote Meat
2684, -- Coyote Steak
1081, -- Crisp Spider Meat
12224, -- Crispy Bat Wing
5479, -- Crispy Lizard Tail
2924, -- Crocolisk Meat
3662, -- Crocolisk Steak
4599, -- Cured Ham Steak
17119, -- Deeprun Rat Kabob
5478, -- Dig Rat Stew
5051, -- Dig Rat
12217, -- Dragonbreath Chili
2687, -- Dry Pork Ribs
9681, -- Grilled King Crawler Legs
2287, -- Haunch of Meat
12204, -- Heavy Kodo Meat
3727, -- Hot Lion Chops
13851, -- Hot Wolf Ribs
12212, -- Jungle Stew
5472, -- Kaldorei Spider Kabob
5467, -- Kodo Meat
5480, -- Lean Venison
1015, -- Lean Wolf Flank
12209, -- Lean Wolf Steak
3731, -- Lion Meat
12223, -- Meaty Bat Wing
3770, -- Mutton Chop
12037, -- Mystery Meat
4739, -- Plainstrider Meat
12184, -- Raptor Flesh
13759, -- Raw Nightfin Snapper
12203, -- Red Wolf Meat
12210, -- Roast Raptor
2681, -- Roasted Boar Meat
5474, -- Roasted Kodo Meat
8952, -- Roasted Quail
1017, -- Seasoned Wolf Kabob
5465, -- Small Spider Leg
6890, -- Smoked Bear Meat
3729, -- Soothing Turtle Bisque
2680, -- Spiced Wolf Meat
17222, -- Spider Sausage
5471, -- Stag Meat
5469, -- Strider Meat
5477, -- Strider Stew
2672, -- Stringy Wolf Meat
2685, -- Succulent Pork Ribs
3728, -- Tasty Lion Steak
3667, -- Tender Crocolisk Meat
12208, -- Tender Wolf Meat
18045, -- Tender Wolf Steak
5470, -- Thunder Lizard Tail
12202, -- Tiger Meat
117, -- Tough Jerky
3712, -- Turtle Meat
12205, -- White Spider Meat
3771, -- Wild Hog Shank
},
[FOM_DIET_BREAD] = {
1113, -- Conjured Bread
5349, -- Conjured Muffin
1487, -- Conjured Pumpernickel
1114, -- Conjured Rye
8075, -- Conjured Sourdough
8076, -- Conjured Sweet Roll
22895, -- Conjured Cinnamon Roll
83004, -- Conjured Mana Orange
19696, -- Harvest Bread
21254, -- Winter Veil Cookie
2683, -- Crab Cake
4541, -- Freshly Baked Bread
17197, -- Gingerbread Cookie
3666, -- Gooey Spider Cake
8950, -- Homemade Cherry Pie
4542, -- Moist Cornbread
4544, -- Mulgore Spice Bread
4601, -- Soft Banana Bread
4540, -- Tough Hunk of Bread
16169, -- Wild Ricecake
},
[FOM_DIET_CHEESE] = {
8932, -- Alterac Swiss
414, -- Dalaran Sharp
2070, -- Darnassian Bleu
422, -- Dwarven Mild
3927, -- Fine Aged Cheddar
1707, -- Stormwind Brie
},
[FOM_DIET_FRUIT] = {
19994, -- Harvest Fruit
8953, -- Deep Fried Plantains
4539, -- Goldenbark Apple
16168, -- Heaven Peach
4602, -- Moon Harvest Pumpkin
4536, -- Shiny Red Apple
4538, -- Snapvine Watermelon
4537, -- Tel'Abim Banana
11950, -- Windblossom Berries
},
[FOM_DIET_BONUS] = {
-- eat for 10 sec to get "well fed" sta/spi bonus
2888, -- Beer Basted Boar Ribs
11584, -- Cactus Apple Surprise
7807, -- Candy Bar
7808, -- Chocolate Square
12224, -- Crispy Bat Wing
17197, -- Gingerbread Cookie
6888, -- Herb Baked Egg
5472, -- Kaldorei Spider Kabob
7806, -- Lollipop
5474, -- Roasted Kodo Meat
2680, -- Spiced Wolf Meat
3220, -- Blood Sausage
5525, -- Boiled Clams
2684, -- Coyote Steak
2683, -- Crab Cake
3662, -- Crocolisk Steak
2687, -- Dry Pork Ribs
5476, -- Fillet of Frenzy
724, -- Goretusk Liver Pie
5477, -- Strider Stew
3726, -- Big Bear Steak
5479, -- Crispy Lizard Tail
3664, -- Crocolisk Gumbo
3665, -- Curiously Tasty Omelet
5527, -- Goblin Deviled Clams
3666, -- Gooey Spider Cake
3727, -- Hot Lion Chops
5480, -- Lean Venison
12209, -- Lean Wolf Steak
3663, -- Murloc Fin Soup
1082, -- Redridge Goulash
1017, -- Seasoned Wolf Kabob
4457, -- Barbecued Buzzard Wing
12213, -- Carrion Surprise
6038, -- Giant Clam Scorcho
13851, -- Hot Wolf Ribs
12212, -- Jungle Stew
12214, -- Mystery Stew
12210, -- Roast Raptor
3729, -- Soothing Turtle Bisque
3728, -- Tasty Lion Steak
16971, -- Clamlette Surprise
12215, -- Heavy Kodo Stew
12218, -- Monster Omelet
12216, -- Spiced Chili Crab
17222, -- Spider Sausage
18045, -- Tender Wolf Steak
-- restores both health and mana
2682, -- Cooked Crab Claw
3448, -- Senggin Root
-- bonus effect with no 10 sec requirement
12217, -- Dragonbreath Chili
13927, -- Cooked Glossy Mightfish
13928, -- Grilled Squid
13929, -- Hot Smoked Bass
13932, -- Poached Sunscale Salmon
13931, -- Nightfin Soup
13934, -- Mightfish Steak
11950, -- Windblossom Berries
18254, -- Runn Tum Tuber Surprise
},
};
+174
View File
@@ -0,0 +1,174 @@
------------------------------------------------------
-- GFWTable.lua
-- Utilities for manipulating tables
------------------------------------------------------
GFWTABLE_THIS_VERSION = 6;
------------------------------------------------------
-- Mean: returns the mean value of a table of numbers
function GFWTable_temp_Mean(aTable)
if (aTable == nil or table.getn(aTable) == 0) then
return nil;
end
return GFWTable.Sum(aTable) / table.getn(aTable);
end
-- Sum: returns the sum of a table of numbers
function GFWTable_temp_Sum(aTable)
if (aTable == nil or table.getn(aTable) == 0) then
return nil;
end
local sum = 0;
for i=1, table.getn(aTable) do
if (tonumber(aTable[i])) then
sum = sum + aTable[i];
end
end
return sum;
end
-- Median: returns the median value (most useful in a table of numbers, but usable in any sorted table)
function GFWTable_temp_Median(aTable)
if (aTable == nil or table.getn(aTable) == 0) then
return nil;
end
if (table.getn(aTable) == 1) then
return aTable[1];
end
local sortedTable = GFWTable.Copy(aTable); -- leave the original table in whatever order it's in
table.sort(sortedTable);
local count = table.getn(sortedTable);
local median;
if (math.mod(count, 2) == 0) then -- even table size
local middleIndex1 = count / 2;
local middleIndex2 = middleIndex1 + 1;
median = (sortedTable[middleIndex1] + sortedTable[middleIndex2]) / 2; --average the two middle values
else -- the table size is odd
local trueMiddleIndex = (count + 1) / 2; -- calculate the middle index
median = sortedTable[trueMiddleIndex];
end
return median;
end
-- Merge: returns the union of two tables (without repeated elements)
function GFWTable_temp_Merge(table1, table2)
local newTable = { };
if (table1) then
for i=1, table.getn(table1) do
table.insert(newTable, table1[i]);
end
end
if (table2) then
for i=1, table.getn(table2) do
if (GFWTable.IndexOf(newTable, table2[i]) == 0) then
table.insert(newTable, table2[i]);
end
end
end
return newTable;
end
-- Diff: returns the difference of two tables (those elements which occur in either but not both)
function GFWTable_temp_Diff(table1, table2)
local newTable = { };
if (table1 == nil) then
table1 = {};
end
if (table2 == nil) then
table2 = {};
end
for i=1, table.getn(table1) do
if (GFWTable.IndexOf(table2, table1[i]) == 0) then
table.insert(newTable, table1[i]);
end
end
for i=1, table.getn(table2) do
if (GFWTable.IndexOf(table1, table2[i]) == 0) then
table.insert(newTable, table2[i]);
end
end
return newTable;
end
-- Subtract: returns a table containing those items in table1 not present in table2
function GFWTable_temp_Subtract(table1, table2)
local newTable = { };
if (table1 == nil or table.getn(table1) == 0) then return newTable; end
if (table2 == nil or table.getn(table2) == 0) then return table1; end
for i=1, table.getn(table1) do
if (GFWTable.IndexOf(table2, table1[i]) == 0) then
table.insert(newTable, table1[i]);
end
end
return newTable;
end
-- IndexOf: returns the index (1-based) of an item in a table
function GFWTable_temp_IndexOf(aTable, item)
return GFWTable.KeyOf(aTable, item) or 0;
end
-- KeyOf: returns the key to an item in a table with numeric or non-numeric keys, or nil if not found
function GFWTable_temp_KeyOf(aTable, item)
if (aTable == nil or type(aTable) ~= "table") then
return nil; -- caller probably won't expect this, causing traceable error in their code
end
for key, value in pairs(aTable) do
if (item == value) then
return key;
end
end
return nil;
end
-- Copy: copies one table's elements into a new table (useful if you want to change them while preserving the first table).
-- Not a deep copy.
function GFWTable_temp_Copy(aTable)
local newTable = { };
for i=1, table.getn(aTable) do
newTable[i] = aTable[i];
end
return newTable;
end
-- Count: returns number of items in a table regardless of whether it has numeric indices.
function GFWTable_temp_Count(aTable)
if (aTable == nil or type(aTable) ~= "table") then
return nil; -- caller probably won't expect this, causing traceable error in their code
end
local count = 0;
for key, value in pairs(aTable) do
count = count + 1;
end
return count;
end
------------------------------------------------------
-- load only if not already loaded
------------------------------------------------------
if (GFWTable == nil) then
GFWTable = {};
end
local G = GFWTable;
if (G.Version == nil or (tonumber(G.Version) ~= nil and G.Version < GFWTABLE_THIS_VERSION)) then
-- Functions
G.Mean = GFWTable_temp_Mean;
G.Sum = GFWTable_temp_Sum;
G.Median = GFWTable_temp_Median;
G.Merge = GFWTable_temp_Merge;
G.Diff = GFWTable_temp_Diff;
G.Subtract = GFWTable_temp_Subtract;
G.IndexOf = GFWTable_temp_IndexOf;
G.KeyOf = GFWTable_temp_KeyOf;
G.Copy = GFWTable_temp_Copy;
G.Count = GFWTable_temp_Count;
-- Set version number
G.Version = GFWTABLE_THIS_VERSION;
end
+202
View File
@@ -0,0 +1,202 @@
------------------------------------------------------
-- GFWUtils.lua
-- Useful utility / debug functions
------------------------------------------------------
GFWUTILS_THIS_VERSION = 8;
------------------------------------------------------
-- Shortcuts for common text color codes
function GFWUtils_temp_HiliteText(text)
if (text == nil) then return nil; end
return HIGHLIGHT_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE;
end
function GFWUtils_temp_RedText(text)
if (text == nil) then return nil; end
return RED_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE;
end
function GFWUtils_temp_GrayText(text)
if (text == nil) then return nil; end
return GRAY_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE;
end
function GFWUtils_temp_LightYellowText(text)
if (text == nil) then return nil; end
return LIGHTYELLOW_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE;
end
-- Prints a message to the chat frame
function GFWUtils_temp_Print(message, r, g, b)
if MTH and MTH.Print then
MTH:Print(message)
else
DEFAULT_CHAT_FRAME:AddMessage(message, (r or GFW_FONT_COLOR.r), (g or GFW_FONT_COLOR.g), (b or GFW_FONT_COLOR.b));
end
end
-- Prints a message to the chat frame once per interval (seconds) or once per session if interval is nil
function GFWUtils_temp_PrintOnce(message, interval, r, g, b)
if (GFWUtils.PrintOnceCache == nil) then
GFWUtils.PrintOnceCache = {};
end
if (interval == nil and GFWUtils.PrintOnceCache[message]) then
return;
end
if (interval and GFWUtils.PrintOnceCache[message] and GetTime() - GFWUtils.PrintOnceCache[message] < interval) then
return;
end
if MTH and MTH.Print then
MTH:Print(message)
else
DEFAULT_CHAT_FRAME:AddMessage(message, (r or GFW_FONT_COLOR.r), (g or GFW_FONT_COLOR.g), (b or GFW_FONT_COLOR.b));
end
GFWUtils.PrintOnceCache[message] = GetTime();
end
-- Prints a message to the chat frame only if Debug is set
function GFWUtils_temp_DebugLog(message)
if (GFWUtils.Debug) then
if MTH and MTH.Print then
MTH:Print(message, "debug")
else
DEFAULT_CHAT_FRAME:AddMessage(message, GFW_DEBUG_COLOR.r, GFW_DEBUG_COLOR.g, GFW_DEBUG_COLOR.b);
end
end
end
-- Prints a message in yellow to the floating messages frame
function GFWUtils_temp_Note(message)
UIErrorsFrame:AddMessage(message, 1.0, 1.0, 0.0, 1.0, UIERRORS_HOLD_TIME);
end
-- Converts string.format to a string.find pattern: "%s hits %s for %d." to "(.+) hits (.+) for (%d+)"
-- based on Recap by Gello
function GFWUtils_temp_FormatToPattern(formatString)
local patternString = formatString;
patternString = string.gsub(patternString, "%%%d+%$([diouXxfgbcsq])", "%%%1"); -- reordering specifiers (e.g. %2$s) stripped
patternString = string.gsub(patternString, "([%$%(%)%.%[%]%*%+%-%?%^])", "%%%1"); -- convert regex special characters
patternString = string.gsub(patternString, "%%c", "(.)"); -- %c to (.)
patternString = string.gsub(patternString, "%%s", "(.+)"); -- %s to (.+)
patternString = string.gsub(patternString, "%%[du]", "(%%d+)"); -- %d to (%d+)
patternString = string.gsub(patternString, "%%([gf])", "(%%d+%%.*%%d*)"); -- %g or %f to (%d+%.*%d*)
return patternString;
end
-- Splits a string into a table of strings separated by 'separator'.
-- e.g. Split(aString, ", ") is the reverse of table.concat(aTable, ", ")
function GFWUtils_temp_Split(aString, separator)
if (aString == nil) then return nil; end
local t = {};
local function helper(segment)
table.insert(t, segment);
end
helper((string.gsub(aString, "(.-)"..separator, helper)));
return t;
end
-- Capitalizes the first letter of each word in aString.
function GFWUtils_temp_TitleCase(aString)
if (aString == nil) then return nil; end
local function capWords(first, rest)
return string.upper(first)..string.lower(rest);
end
return string.gsub(aString, "(%w)([%w_']*)", capWords);
end
-- Splits a cash amount into gold, siver, and copper
function GFWUtils_temp_GSC(money)
if (money == nil) then money = 0; end
local g = math.floor(money / 10000);
local s = math.floor((money - (g*10000)) / 100);
local c = math.floor(money - (g*10000) - (s*100));
return g,s,c;
end
-- Formats money text by color for gold, silver, copper
-- discards copper for amounts greater than 1g unless second arg evaluates true
-- based on Auctioneer
function GFWUtils_temp_TextGSC(money, noRound)
local GSC_GOLD="ffd100";
local GSC_SILVER="e6e6e6";
local GSC_COPPER="c8602c";
local GSC_START="|cff%s%d%s|r";
local GSC_PART=" |cff%s%02d%s|r";
local GSC_NONE="|cffa0a0a0none|r";
local g, s, c = GFWUtils.GSC(money);
local gsc = "";
if (g > 0) then
gsc = format(GSC_START, GSC_GOLD, g, "g");
if (s > 0) then
gsc = gsc..format(GSC_PART, GSC_SILVER, s, "s");
if (noRound and c > 0) then
gsc = gsc..format(GSC_PART, GSC_COPPER, c, "c");
end
end
elseif (s > 0) then
gsc = format(GSC_START, GSC_SILVER, s, "s");
if (c > 0) then
gsc = gsc..format(GSC_PART, GSC_COPPER, c, "c");
end
elseif (c > 0) then
gsc = gsc..format(GSC_START, GSC_COPPER, c, "c");
else
gsc = GSC_NONE;
end
return gsc;
end
function GFWUtils_temp_ItemLink(linkInfo)
local sName, sLink, iQuality, iLevel, sType, sSubType, iCount = GetItemInfo(linkInfo);
if (sName) then
local _, _, _, color = GetItemQualityColor(iQuality);
local linkFormat = "%s|H%s|h[%s]|h|r";
return string.format(linkFormat, color, sLink, sName);
else
return nil;
end
end
------------------------------------------------------
-- load only if not already loaded
------------------------------------------------------
if (GFWUtils == nil) then
GFWUtils = {};
end
local G = GFWUtils;
if (G.Version == nil or (tonumber(G.Version) ~= nil and G.Version < GFWUTILS_THIS_VERSION)) then
-- Constants
GFW_FONT_COLOR = {r=0.25, g=1.0, b=1.0};
GFW_DEBUG_COLOR = {r=1.0, g=0.75, b=0.25};
G.Debug = false;
-- Functions
G.Hilite = GFWUtils_temp_HiliteText;
G.Red = GFWUtils_temp_RedText;
G.Gray = GFWUtils_temp_GrayText;
G.LtY = GFWUtils_temp_LightYellowText;
G.Print = GFWUtils_temp_Print;
G.PrintOnce = GFWUtils_temp_PrintOnce;
G.DebugLog = GFWUtils_temp_DebugLog;
G.Note = GFWUtils_temp_Note;
G.FormatToPattern = GFWUtils_temp_FormatToPattern;
G.Split = GFWUtils_temp_Split;
G.TitleCase = GFWUtils_temp_TitleCase;
G.GSC = GFWUtils_temp_GSC;
G.TextGSC = GFWUtils_temp_TextGSC;
G.ItemLink = GFWUtils_temp_ItemLink;
-- Set version number
G.Version = GFWUTILS_THIS_VERSION;
end
+12
View File
@@ -0,0 +1,12 @@
## Interface: 11200
## Version: 11200.2
## Title: Fizzwidget Feed-O-Matic
## Author: Gazmik Fizzwidget
## Notes: Helps a Hunter keep his pets well fed (and the food in his inventory under control)
## SavedVariables: FOM_Config, FOM_FoodQuality, FOM_AddedFoods, FOM_RemovedFoods, FOM_Cooking, FOM_QuestFood, FOM_LocaleInfo
GFWUtils.lua
GFWTable.lua
localization.lua
FeedOMatic_Emotes.lua
FeedOMatic_Foods.lua
FeedOMatic.lua
+5
View File
@@ -0,0 +1,5 @@
<Addon name="Fizzwidget Feed-O-Matic" author="Gazmik Fizzwidget" email="gazmik@fizzwidget.com" url="http://fizzwidget.com/huntershelper/">
<Description>Helps a Hunter keep his pets well fed (and the food in his inventory under control).</Description>
<CurrentVersion ver="11200.2" />
<UpdateFile url="http://fizzwidget.com/UpdateUI.xml" />
</Addon>
+18
View File
@@ -0,0 +1,18 @@
<!--
FeedOMatic Module Loader
Loads all FeedOMatic addon code and wraps it in the MTH module system
-->
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<!-- Load original FeedOMatic addon files -->
<Include file="GFWUtils.lua"/>
<Include file="GFWTable.lua"/>
<Include file="localization.lua"/>
<Include file="FeedOMatic_Emotes.lua"/>
<Include file="FeedOMatic_Foods.lua"/>
<Include file="FeedOMatic.lua"/>
<Include file="runtime.xml"/>
<Include file="UpdateUI.xml"/>
<!-- Load ModuleHunt wrapper -->
<Include file="module.lua"/>
</Ui>
+304
View File
@@ -0,0 +1,304 @@
-----------------------------------------------------
-- localization.lua
-- English strings by default, localizations override with their own.
------------------------------------------------------
-- Key bindings
BINDING_HEADER_FEEDOMATIC = "Fizzwidget Feed-O-Matic";
BINDING_NAME_FEEDOMATIC = "Feed Pet";
-- Diet names. These should be the all-lowercase versions of the six diets returned from GetPetFoodTypes(). (Want to get them all nice and quick for your localization? Go tame a bear... they eat anything.)
-- THESE STRINGS MUST BE LOCALIZED for Feed-O-Matic to work properly in other locales.
FOM_DIET_MEAT = "meat";
FOM_DIET_FISH = "fish";
FOM_DIET_BREAD = "bread";
FOM_DIET_CHEESE = "cheese";
FOM_DIET_FRUIT = "fruit";
FOM_DIET_FUNGUS = "fungus";
-- If the player has a buff whose icon name contains "Ability_Mount" and whose name contains one of these substrings, we assume the player is mounted. We have to use this rather oblique way to check for mounted because some other buffs use the Ability_Mount_* icons. If these aren't localized, we may not recognize when the player is mounted and still try to feed the pet.
FOM_MOUNT_NAME_SUBSTRINGS = { "kodo", "wolf", "raptor", "steed", "horse", "ram", "saber", "mechanostrider" };
-- It's not clear whether the 5th and 6th returns from GetItemInfo() are supposed to be localized... so we have localized keys for them just in case. If these aren't localized, we'll just needlessly search your ammo bags for food.
FOM_AMMO_POUCH = "Ammo Pouch";
FOM_QUIVER = "Quiver";
-- From here on down, the localized strings are just for readability... they don't affect whether Feed-O-Matic works.
-- Two special diets; one is used for tracking food that provides a bonus (or at least, that you don't want to have fed to your pet when the 'savebonus' option is on), and another that's used in the chat-line interface for listing all diets.
FOM_DIET_BONUS = "bonus";
FOM_DIET_ALL = "all";
-- Used in tooltips to indicate food quality.
FOM_QUALITY_UNKNOWN = "%s can eat this, but hasn't tried it yet.";
FOM_QUALITY_UNDER = "%s doesn't like this anymore.";
FOM_QUALITY_MIGHT = "%s might eat this.";
FOM_QUALITY_WILL = "%s will eat this.";
FOM_QUALITY_LIKE = "%s likes to eat this.";
FOM_QUALITY_LOVE = "%s loves to eat this.";
-- User-visible errors
FOM_ERROR_NO_PET = "You don't have a pet to feed.";
FOM_ERROR_PET_DEAD = "Your pet is dead.";
FOM_ERROR_NO_FEEDABLE_PET = "You don't have a feedable pet.";
FOM_ERROR_IN_COMBAT = "You can't feed your pet during combat.";
FOM_ERROR_FOOD_NOT_FOUND = "%s could not find %s in your pack.";
FOM_ERROR_NO_FOOD = "%s could not find any food in your pack.";
FOM_ERROR_NO_FOOD_NO_FALLBACK = "%s could not find any food in your pack that you haven't forbidden %s to eat.";
FOM_PRONOUN_MALE = "him";
FOM_PRONOUN_FEMALE = "her";
-- Feeding status messages
FOM_FEEDING_EAT_ANOTHER = "%s doesn't like that food and will try something else...";
FOM_FEEDING_FEED_ANOTHER = "needs to feed %s something else...";
FOM_FEEDING_EAT = "%s eats a %s from your pack.";
FOM_FEEDING_FEED = "feeds %s a %s. ";
FOM_PET_HUNGRY = "%s is hungry!";
FOM_PET_VERY_HUNGRY = "%s is very hungry!";
-- Beast family names
BAT = "Bat";
BEAR = "Bear";
BOAR = "Boar";
CARRION_BIRD = "Carrion Bird";
CAT = "Cat";
CRAB = "Crab";
CROCOLISK = "Crocolisk";
GORILLA = "Gorilla";
HYENA = "Hyena";
OWL = "Owl";
RAPTOR = "Raptor";
SCORPID = "Scorpid";
SPIDER = "Spider";
TALLSTRIDER = "Tallstrider";
TURTLE = "Turtle";
WIND_SERPENT = "Wind Serpent";
WOLF = "Wolf";
FOM_OPTIONS_HEADER = "Feed-O-Matic Options";
FOM_OPTIONS_GENERAL = "General options:";
FOM_OPTIONS_FOOD_CHOICE = "Avoid foods used in Cooking:";
FOM_OPTIONS_FEED_NOTIFY = "Notify when feeding:";
FOM_OPTIONS_WARNING = "Warn that your pet needs feeding:";
FOM_KEEPOPEN = "Try to keep at least";
FOM_KEEPOPEN_SLOTS = "slots open in your bags.";
FOM_KEEPOPEN_INFO = "(Will choose foods from smaller stacks when low on space, regardless of how well your pet likes them.)";
FOM_OptionsButtonText = {
["Tooltip"] = "Show your pet's opinion of foods in their tooltips",
["AvoidQuestFood"] = "Avoid foods needed for quests",
["AvoidBonusFood"] = "Avoid foods that have a bonus effect when eaten",
["PreferHigherQuality"] = "Prefer foods your pet likes more",
["Fallback"] = "Fall back to otherwise-avoided foods if out of others",
["SaveForCook_All"] = "all foods used in cooking",
["SaveForCook_Green"] = "only foods used in |cff3fbf3f\"easy\"|r or better recipes",
["SaveForCook_Yellow"] = "only foods used in |cffffff00\"medium\"|r or better recipes",
["SaveForCook_Orange"] = "only foods used in |cffff7f3f\"difficult\"|r recipes",
["SaveForCook_None"] = "Don't save foods used in cooking",
["IconWarning"] = "Flash icon",
["TextWarning"] = "Show text",
["AudioWarning"] = "Play sound",
["AudioWarningBell"] = "Generic bell sound instead of pet-specific",
["AlertEmote"] = "Via emote (seen by others)",
["AlertChat"] = "In the chat window (seen by you only)",
["AlertNone"] = "Don't notify",
["LevelContent"] = "when \"content\"",
["LevelUnhappy"] = "when \"unhappy\"",
["LevelOff"] = "Don't warn",
};
------------------------------------------------------
if (GetLocale() == "frFR") then
-- Diet names. These should be the all-lowercase versions of the six diets returned from GetPetFoodTypes(). (Want to get them all nice and quick for your localization? Go tame a bear... they eat anything.)
-- THESE STRINGS MUST BE LOCALIZED for Feed-O-Matic to work properly in other locales.
FOM_DIET_MEAT = "viande";
FOM_DIET_FISH = "poisson";
FOM_DIET_BREAD = "pain";
FOM_DIET_CHEESE = "fromage";
FOM_DIET_FRUIT = "fruit";
FOM_DIET_FUNGUS = "champignon";
-- If the player has a buff whose icon name contains "Ability_Mount" and whose name contains one of these substrings, we assume the player is mounted. We have to use this rather oblique way to check for mounted because some other buffs use the Ability_Mount_* icons. If these aren't localized, we may not recognize when the player is mounted and still try to feed the pet.
FOM_MOUNT_NAME_SUBSTRINGS = { "kodo", "loup", "raptor", "steed", "cheval", "bélier", "tigre", "mécanotrotteur", };
-- It's not clear whether the 5th and 6th returns from GetItemInfo() are supposed to be localized... so we have localized keys for them just in case. If these aren't localized, we'll just needlessly search your ammo bags for food.
FOM_AMMO_POUCH = "Giberne";
FOM_QUIVER = "Carquois";
-- From here on down, the localized strings are just for readability... they don't affect whether Feed-O-Matic works.
-- Two special diets; one is used for tracking food that provides a bonus (or at least, that you don't want to have fed to your pet when the 'savebonus' option is on), and another that's used in the chat-line interface for listing all diets.
FOM_DIET_BONUS = "bonus";
FOM_DIET_ALL = "tous";
-- Used in tooltips to indicate food quality.
FOM_QUALITY_UNKNOWN = "%s peut le manger, mais n'a jamais essayé.";
FOM_QUALITY_UNDER = "%s n'en mange plus désormais.";
FOM_QUALITY_MIGHT = "%s en mangera peut-être.";
FOM_QUALITY_WILL = "%s en mangera.";
FOM_QUALITY_LIKE = "%s aime en manger.";
FOM_QUALITY_LOVE = "%s adore en manger.";
-- User-visible errors
FOM_ERROR_NO_PET = "Vous n'avez pas de familier.";
FOM_ERROR_PET_DEAD = "Votre familier est mort.";
FOM_ERROR_NO_FEEDABLE_PET = "Vous n'avez pas de familier capable de manger.";
FOM_ERROR_FOOD_NOT_FOUND = "%s n'a pas trouvé de %s dans votre sac.";
FOM_ERROR_NO_FOOD = "%s n'a pas trouvé de nourriture dans votre sac.";
-- Feeding status messages
FOM_FEEDING_EAT_ANOTHER = "%s n'aime pas cette nourriture et va essayer autre chose..."
FOM_FEEDING_FEED_ANOTHER = "cherche autre chose à donner à %s...";
FOM_FEEDING_EAT = "%s mange un(e) %s.";
FOM_FEEDING_FEED = "donne à %s à manger un(e) %s. ";
-- Beast family names
BAT = "Chauve-souris";
BEAR = "Ours";
BOAR = "Sanglier";
CARRION_BIRD = "Charognard";
CAT = "Félin";
CRAB = "Crabe";
CROCOLISK = "Crocilisque";
GORILLA = "Gorille";
HYENA = "Hyène";
OWL = "Chouette";
RAPTOR = "Raptor";
SCORPID = "Scorpide";
SPIDER = "Araignée";
TALLSTRIDER = "Haut-trotteur";
TURTLE = "Tortue";
WIND_SERPENT = "Serpent des vents";
WOLF = "Loup";
FOM_PET_HUNGRY = "%s a faim!";
FOM_PET_VERY_HUNGRY = "%s a très faim!";
FOM_OPTIONS_HEADER = "Feed-O-Matic Options";
FOM_OPTIONS_GENERAL = "Options générales:";
FOM_OPTIONS_FOOD_CHOICE = "Eviter la nourriture utilisée en cuisine:";
FOM_OPTIONS_FEED_NOTIFY = "Prévenir lorsque votre familier est nourrit:";
FOM_OPTIONS_WARNING = "Avertir quand votre familier a besoin d'être nourrit:";
FOM_KEEPOPEN = "Essayer de garder au moins";
FOM_KEEPOPEN_SLOTS = "emplacements de sac libres";
FOM_KEEPOPEN_INFO = "(Le familier choisira la nourriture des piles les plus petites, sans tenir compte de ses préférences.)";
FOM_OptionsButtonText = {
["Tooltip"] = "Afficher l'avis de votre familier concernant la nourriture",
["AvoidQuestFood"] = "Eviter la nourriture utile dans les quêtes",
["AvoidBonusFood"] = "Eviter la nourriture donnant un bonus",
["PreferHigherQuality"] = "Privilégier la nourriture que votre familier préfère",
["Fallback"] = "Utiliser la nourriture évitée s'il n'y en a plus d'autres",
["SaveForCook_All"] = "Toutes nourritures utilisées pour la cuisine",
["SaveForCook_Green"] = "si elle est utilisée dans les recettes |cff3fbf3f\"faciles\"|r ou supérieures",
["SaveForCook_Yellow"] = "si elle est utilisée dans les recettes |cffffff00\"moyennes\"|r ou supérieures",
["SaveForCook_Orange"] = "si elle est utilisée dans les recettes |cffff7f3f\"difficiles\"|r",
["SaveForCook_None"] = "Ne pas éviter la nourriture utilisée en cuisine",
["IconWarning"] = "Clignoter l'icône",
["TextWarning"] = "Afficher un texte",
["AudioWarning"] = "Jouer un son",
["AudioWarningBell"] = "Un son de cloche au lieu du cri du familier",
["AlertEmote"] = "Via emote (visible par les autres)",
["AlertChat"] = "Dans la fenêtre de discussion (visible uniquement par vous)",
["AlertNone"] = "Ne pas prévenir",
["LevelContent"] = "quand \"content\"",
["LevelUnhappy"] = "quand \"mécontent\"",
["LevelOff"] = "Ne pas avertir",
};
end
------------------------------------------------------
if (GetLocale() == "deDE") then
-- Diet names. These should be the all-lowercase versions of the six diets returned from GetPetFoodTypes(). (Want to get them all nice and quick for your localization? Go tame a bear... they eat anything.)
-- THESE STRINGS MUST BE LOCALIZED for Feed-O-Matic to work properly in other locales.
FOM_DIET_MEAT = "fleisch";
FOM_DIET_FISH = "fisch";
FOM_DIET_BREAD = "brot";
FOM_DIET_CHEESE = "käse";
FOM_DIET_FRUIT = "obst";
-- FOM_DIET_FUNGUS = "fungus"; -- same as English (?), so we don't need to re-define it.
-- If the player has a buff whose icon name contains "Ability_Mount" and whose name contains one of these substrings, we assume the player is mounted. We have to use this rather oblique way to check for mounted because some other buffs use the Ability_Mount_* icons. If these aren't localized, we may not recognize when the player is mounted and still try to feed the pet.
-- FOM_MOUNT_NAME_SUBSTRINGS = { "kodo", "wolf", "raptor", "steed", "horse", "ram", "saber", "mechanostrider" };
-- It's not clear whether the 5th and 6th returns from GetItemInfo() are supposed to be localized... so we have localized keys for them just in case.
FOM_AMMO_POUCH = "Munitionsbeutel";
FOM_QUIVER = "Köcher";
-- From here on down, the localized strings are just for readability; they don't affect whether Feed-O-Matic works.
-- Two special diets; one is used for tracking food that provides a bonus (or at least, that you don't want to have fed to your pet when the 'savebonus' option is on), and another that's used in the chat-line interface for listing all diets.
-- FOM_DIET_BONUS = "bonus"; -- same as English(?), so we don't need to re-define it.
FOM_DIET_ALL = "alles";
-- Used in tooltips to indicate food quality.
FOM_QUALITY_UNKNOWN = "%s kann das fressen, hat es aber noch nicht probiert.";
FOM_QUALITY_UNDER = "%s mag das nicht mehr fressen.";
FOM_QUALITY_MIGHT = "%s mag das möglicherweise fressen.";
FOM_QUALITY_WILL = "%s mag das fressen.";
FOM_QUALITY_LIKE = "%s frisst das gerne.";
FOM_QUALITY_LOVE = "%s liebt es, das zu fressen.";
-- User-visible errors
FOM_ERROR_NO_PET = "Du hast kein Tier um es zu füttern.";
FOM_ERROR_PET_DEAD = "Dein Tier ist tot.";
FOM_ERROR_NO_FEEDABLE_PET = "Du hast kein Tier das man füttern kann.";
FOM_ERROR_FOOD_NOT_FOUND = "%s kann %s nicht in Deinem Rucksack finden.";
FOM_ERROR_NO_FOOD = "%s findet nichts zu fressen in Deinem Rucksack.";
-- Feeding status messages
FOM_FEEDING_EAT_ANOTHER = "%s mag dieses Futter nicht und probiert etwas anderes...";
FOM_FEEDING_FEED_ANOTHER = "sucht nach etwas anderem um %s zu füttern...";
FOM_FEEDING_EAT = "%s frisst ein %s aus Deinem Rucksack.";
FOM_FEEDING_FEED = "füttert %s ein %s. ";
-- Beast family names
BAT = "Fledermaus";
BEAR = "Bär";
BOAR = "Eber";
CARRION_BIRD = "Aasvogel";
CAT = "Katze";
CRAB = "Krebs";
CROCOLISK = "Krokilisk";
-- GORILLA = "Gorilla"; -- same as enUS
HYENA = "Hyäne";
OWL = "Eule";
-- RAPTOR = "Raptor"; -- same as enUS
SCORPID = "Skorpid";
SPIDER = "Spinne";
TALLSTRIDER = "Weitschreiter";
TURTLE = "Schildkröte";
WIND_SERPENT = "Windnatter";
-- WOLF = "Wolf"; -- same as enUS
end
------------------------------------------------------
if (GetLocale() == "koKR") then
-- Diet names. These should be the all-lowercase versions of the six diets returned from GetPetFoodTypes(). (Want to get them all nice and quick for your localization? Go tame a bear... they eat anything.)
-- THESE STRINGS MUST BE LOCALIZED for Feed-O-Matic to work properly in other locales.
-- FOM_DIET_MEAT = "meat";
-- FOM_DIET_FISH = "fish";
-- FOM_DIET_BREAD = "bread";
-- FOM_DIET_CHEESE = "cheese";
-- FOM_DIET_FRUIT = "fruit";
-- FOM_DIET_FUNGUS = "fungus";
-- If the player has a buff whose icon name contains "Ability_Mount" and whose name contains one of these substrings, we assume the player is mounted. We have to use this rather oblique way to check for mounted because some other buffs use the Ability_Mount_* icons.
-- FOM_MOUNT_NAME_SUBSTRINGS = { "kodo", "wolf", "raptor", "steed", "horse", "ram", "saber", "mechanostrider" };
-- It's not clear whether the 5th and 6th returns from GetItemInfo() are supposed to be localized... so we have localized keys for them just in case.
-- FOM_AMMO_POUCH = "Ammo Pouch";
FOM_QUIVER = "화살통";
end
+340
View File
@@ -0,0 +1,340 @@
------------------------------------------------------
-- MetaHunt: FeedOMatic Module Wrapper
-- Modern module abstraction for the FeedOMatic addon
------------------------------------------------------
local MTH_FeedOMatic = {
name = "feedomatic",
enabled = false,
version = "1.0.3",
events = {
"VARIABLES_LOADED",
"MERCHANT_SHOW",
"MERCHANT_UPDATE",
"MTH_PET_LIVE_STATE_CHANGED",
"PET_ATTACK_START",
"PET_ATTACK_STOP",
"PET_STABLE_SHOW",
"PET_STABLE_UPDATE",
"TRADE_SKILL_SHOW",
"TRADE_SKILL_UPDATE",
"CHAT_MSG_SPELL_TRADESKILLS",
"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS",
"UI_ERROR_MESSAGE",
"PET_BAR_SHOWGRID",
"PET_BAR_UPDATE",
"PET_UI_UPDATE",
"UNIT_HAPPINESS",
"PLAYER_REGEN_ENABLED",
},
initialized = false,
variablesLoadedProcessed = false,
}
local MTH_PETL_HOOK_BOUNDARY_KEY = "pet-lifecycle-hooks"
local MTH_FeedOMatic_MerchantProbeFrame = nil
function MTH_FeedOMatic_OnUpdate(elapsed)
if not elapsed then
return
end
if not (MTH and MTH.IsModuleEnabled and MTH:IsModuleEnabled("feedomatic", true)) then
return
end
if type(FOM_OnUpdate) == "function" then
FOM_OnUpdate(elapsed)
end
end
local function MTH_FeedOMatic_GetRuntimeFrame()
return getglobal("Frame_GFW_FeedOMatic")
end
local function MTH_FeedOMatic_CaptureHookBoundary()
if not (MTH and MTH.CaptureHookBoundary) then
return
end
MTH:CaptureHookBoundary(MTH_PETL_HOOK_BOUNDARY_KEY, {
{ globalName = "PetAbandon", originalName = "MTH_PETL_Original_PetAbandon" },
})
end
local function MTH_FeedOMatic_RestoreHookBoundary()
if not (MTH and MTH.RestoreHookBoundary) then
return
end
MTH:RestoreHookBoundary(MTH_PETL_HOOK_BOUNDARY_KEY)
end
local function MTH_FeedOMatic_ApplyLegacyHooks()
local canTouchPetAbandon = true
if MTH and MTH.GetGlobalHookOwner then
local abandonOwner = MTH:GetGlobalHookOwner("PetAbandon")
if abandonOwner and abandonOwner ~= MTH_PETL_HOOK_BOUNDARY_KEY then
canTouchPetAbandon = false
end
end
local abandonHook = MTH_PetAbandonHook or FOM_PetAbandon
local abandonOriginal = MTH_PETL_Original_PetAbandon or FOM_Original_PetAbandon
if type(abandonHook) == "function" and type(abandonOriginal) == "function" then
if canTouchPetAbandon and (PetAbandon == abandonOriginal or PetAbandon == abandonHook) then
PetAbandon = abandonHook
end
end
end
local function MTH_FeedOMatic_CallLegacyOnEvent(evt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
if type(FOM_OnEvent) ~= "function" then
return
end
local frame = MTH_FeedOMatic_GetRuntimeFrame()
if not frame then
return
end
local oldThis = this
local oldEvent = event
local oldArg1, oldArg2, oldArg3, oldArg4, oldArg5 = arg1, arg2, arg3, arg4, arg5
local oldArg6, oldArg7, oldArg8, oldArg9 = arg6, arg7, arg8, arg9
this = frame
event = evt
arg1, arg2, arg3, arg4, arg5 = a1, a2, a3, a4, a5
arg6, arg7, arg8, arg9 = a6, a7, a8, a9
local ok = pcall(function()
FOM_OnEvent(evt, a1)
end)
this = oldThis
event = oldEvent
arg1, arg2, arg3, arg4, arg5 = oldArg1, oldArg2, oldArg3, oldArg4, oldArg5
arg6, arg7, arg8, arg9 = oldArg6, oldArg7, oldArg8, oldArg9
if not ok and MTH and MTH.DebugPrint then
MTH:DebugPrint("FeedOMatic legacy OnEvent call failed for event: " .. tostring(evt))
end
end
local function MTH_FeedOMatic_EnsureVariablesLoaded(module)
if not module or module.variablesLoadedProcessed then
return
end
MTH_FeedOMatic_CallLegacyOnEvent("VARIABLES_LOADED")
module.variablesLoadedProcessed = true
end
local function MTH_FeedOMatic_SyncSavedVariables()
if not MTH or not MTH.GetModuleSavedVariables then
return
end
local moduleStore = MTH:GetModuleSavedVariables("feedomatic")
if not moduleStore.legacy then
moduleStore.legacy = {}
end
if type(FOM_Config) == "table" then
moduleStore.legacy.FOM_Config = FOM_Config
elseif type(moduleStore.legacy.FOM_Config) == "table" then
FOM_Config = moduleStore.legacy.FOM_Config
end
if type(FOM_FoodQuality) == "table" then
moduleStore.legacy.FOM_FoodQuality = FOM_FoodQuality
elseif type(moduleStore.legacy.FOM_FoodQuality) == "table" then
FOM_FoodQuality = moduleStore.legacy.FOM_FoodQuality
end
if type(FOM_AddedFoods) == "table" then
moduleStore.legacy.FOM_AddedFoods = FOM_AddedFoods
elseif type(moduleStore.legacy.FOM_AddedFoods) == "table" then
FOM_AddedFoods = moduleStore.legacy.FOM_AddedFoods
end
if type(FOM_RemovedFoods) == "table" then
moduleStore.legacy.FOM_RemovedFoods = FOM_RemovedFoods
elseif type(moduleStore.legacy.FOM_RemovedFoods) == "table" then
FOM_RemovedFoods = moduleStore.legacy.FOM_RemovedFoods
end
if type(FOM_Cooking) == "table" then
moduleStore.legacy.FOM_Cooking = FOM_Cooking
elseif type(moduleStore.legacy.FOM_Cooking) == "table" then
FOM_Cooking = moduleStore.legacy.FOM_Cooking
end
if type(FOM_QuestFood) == "table" then
moduleStore.legacy.FOM_QuestFood = FOM_QuestFood
elseif type(moduleStore.legacy.FOM_QuestFood) == "table" then
FOM_QuestFood = moduleStore.legacy.FOM_QuestFood
end
if type(FOM_LocaleInfo) == "table" then
moduleStore.legacy.FOM_LocaleInfo = FOM_LocaleInfo
elseif type(moduleStore.legacy.FOM_LocaleInfo) == "table" then
FOM_LocaleInfo = moduleStore.legacy.FOM_LocaleInfo
end
end
local function MTH_FeedOMatic_Log(message, severity)
if type(MTH_Log) == "function" then
local logSeverity = severity or "debug"
MTH_Log("[FeedOMatic] " .. tostring(message or ""), logSeverity)
end
end
local function MTH_FeedOMatic_DebugMerchantScan(sourceEvent)
if type(MTH_GetMerchantFoodsByDiet) ~= "function" then
MTH_FeedOMatic_Log(tostring(sourceEvent) .. ": MTH_GetMerchantFoodsByDiet is not available yet")
return
end
local merchantFoods = MTH_GetMerchantFoodsByDiet()
local knownCount = 0
local unknownCount = 0
if type(merchantFoods) == "table" then
if type(merchantFoods.items) == "table" then
knownCount = table.getn(merchantFoods.items)
end
if type(merchantFoods.unknown) == "table" then
unknownCount = table.getn(merchantFoods.unknown)
end
end
local merchantName = UnitName("npc") or UnitName("target") or "unknown"
MTH_FeedOMatic_Log(tostring(sourceEvent) .. ": wrapper scan for " .. tostring(merchantName) .. " | known=" .. tostring(knownCount) .. " | unknown=" .. tostring(unknownCount))
if type(merchantFoods.byDiet) == "table" then
for dietName, rows in merchantFoods.byDiet do
local dietCount = 0
if type(rows) == "table" then
dietCount = table.getn(rows)
end
MTH_FeedOMatic_Log("diet " .. tostring(dietName) .. ": " .. tostring(dietCount) .. " item(s)", "debug")
if type(rows) == "table" then
for _, row in rows do
MTH_FeedOMatic_Log(" - [" .. tostring(row.id) .. "] " .. tostring(row.name) .. " (slot=" .. tostring(row.index) .. ")", "debug")
end
end
end
end
if unknownCount > 0 and type(merchantFoods.unknown) == "table" then
for _, row in merchantFoods.unknown do
MTH_FeedOMatic_Log("unknown map: [" .. tostring(row.id) .. "] " .. tostring(row.name) .. " (slot=" .. tostring(row.index) .. ")", "debug")
end
end
end
local function MTH_FeedOMatic_SetMerchantProbeEnabled(enabled)
if not MTH_FeedOMatic_MerchantProbeFrame then
MTH_FeedOMatic_MerchantProbeFrame = CreateFrame("Frame", "MTH_FeedOMatic_MerchantProbeFrame")
MTH_FeedOMatic_MerchantProbeFrame:SetScript("OnEvent", function()
local evt = event
if evt == "MERCHANT_SHOW" or evt == "MERCHANT_UPDATE" then
MTH_FeedOMatic_Log("probe event received: " .. tostring(evt), "debug")
MTH_FeedOMatic_DebugMerchantScan(evt)
end
end)
end
if enabled then
MTH_FeedOMatic_MerchantProbeFrame:RegisterEvent("MERCHANT_SHOW")
MTH_FeedOMatic_MerchantProbeFrame:RegisterEvent("MERCHANT_UPDATE")
MTH_FeedOMatic_Log("merchant probe enabled", "debug")
else
MTH_FeedOMatic_MerchantProbeFrame:UnregisterEvent("MERCHANT_SHOW")
MTH_FeedOMatic_MerchantProbeFrame:UnregisterEvent("MERCHANT_UPDATE")
end
end
function MTH_FeedOMatic:init()
-- FeedOMatic initializes via its VARIABLES_LOADED event
-- This is called after the core MTH framework is loaded
MTH_FEED_WRAPPER_MODE = true
MTH_FOM_WRAPPER_MODE = MTH_FEED_WRAPPER_MODE
MTH_FeedOMatic_SyncSavedVariables()
if not self.initialized and not getglobal("FOM_METAHUNT_ONLOAD_DONE") and FOM_OnLoad then
local frame = MTH_FeedOMatic_GetRuntimeFrame()
if frame then
local oldThis = this
this = frame
pcall(function()
FOM_OnLoad()
end)
this = oldThis
FOM_METAHUNT_ONLOAD_DONE = true
end
end
MTH_FeedOMatic_CaptureHookBoundary()
self.initialized = true
if self.enabled then
MTH_FeedOMatic_EnsureVariablesLoaded(self)
end
end
function MTH_FeedOMatic:setEnabled(enabled)
if enabled then
if not self.initialized then
self:init()
end
MTH_FeedOMatic_ApplyLegacyHooks()
MTH_FeedOMatic_CaptureHookBoundary()
MTH_FeedOMatic_SyncSavedVariables()
MTH_FeedOMatic_EnsureVariablesLoaded(self)
MTH_FeedOMatic_SetMerchantProbeEnabled(false)
if FOM_FeedButton then
FOM_FeedButton:Show()
end
else
-- Disable FeedOMatic functionality
MTH_FeedOMatic_RestoreHookBoundary()
if type(FOM_State) == "table" then
FOM_State.ShouldFeed = false
end
MTH_FeedOMatic_SetMerchantProbeEnabled(false)
if FOM_FeedButton then
FOM_FeedButton:Hide()
end
end
end
function MTH_FeedOMatic:onEvent(event, arg1, arg2, arg3, arg4, arg5)
if event == "VARIABLES_LOADED" then
MTH_FeedOMatic_EnsureVariablesLoaded(self)
return
end
if event == "MTH_PET_LIVE_STATE_CHANGED" then
MTH_FeedOMatic_CallLegacyOnEvent("PET_BAR_UPDATE")
MTH_FeedOMatic_CallLegacyOnEvent("PET_UI_UPDATE")
MTH_FeedOMatic_CallLegacyOnEvent("UNIT_HAPPINESS", "pet")
return
end
MTH_FeedOMatic_CallLegacyOnEvent(event, arg1, arg2, arg3, arg4, arg5)
end
function MTH_FeedOMatic:cleanup()
-- Cleanup code when module is unloaded
MTH_FeedOMatic_RestoreHookBoundary()
if type(FOM_State) == "table" then
FOM_State.ShouldFeed = false
end
MTH_FeedOMatic_SetMerchantProbeEnabled(false)
if FOM_FeedButton then
FOM_FeedButton:Hide();
end
end
-- Register with MTH
MTH:RegisterModule("feedomatic", MTH_FeedOMatic)
MTH_FOM_OnUpdate = MTH_FeedOMatic_OnUpdate
+87
View File
@@ -0,0 +1,87 @@
------------------------------------------------------
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! Just 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:
- 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.)
- 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; this behavior can be customized based on the difficulty of the recipies (so, for example, you can either save all cookable food or only save the foods most likely to increase your Cooking skill).
- 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`) - Show the Options window.
or:
`/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.
`feed` - Feed your pet (automatically finds an appropriate food).
`feed <item link>` - Feed your pet a specific food.
`add <diet> <item link>` - Add food to the list for a specific diet (meat, fish, fruit, etc).
`remove <diet> <item link>` - 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, French, and German (for now). Localizers interested in helping with other WoW client languages please contact gazmik@fizzwidget.com.
------------------------------------------------------
VERSION HISTORY
v. 12000.2 - 2006/10/27
- Now always prefers conjured foods if available when feeding a pet that can eat them. (This was supposed to have been the case before, but the implementation turned out to be unreliable.)
- Fixed some issues which could result in Feed-O-Matic feeding the pet a food you'd told it to avoid, even if the "fall back" option was turned off. Also, a clearer error message is given if "fall back" is off and we can't find any allowed foods.
- The various reminder options for when your pet needs feeding (flashing the happiness icon, text messages, sounds) are now suppressed while you or your pet is in combat or if your pet is dead.
- Feed-O-Matic posts its own error message if you attempt use it to feed your pet while in combat. (Instead of trying to feed the pet anyway, causing WoW itself to post an error message.)
- Added a number of items to the default foods list (including some holiday treats and the new level 55 mage-conjured bread).
v. 11200.1 - 2006/08/22
- Updated TOC to reflect compatibility with WoW patch 1.12.
- Updated use of WoW's UnitSex() function to match changes in its behavior from WoW patch 1.11... your pet's gender should be reported correctly again.
v. 11100.1 - 2006/06/20
- Updated TOC to reflect compatibility with WoW patch 1.11. (No actual changes were needed.)
- Added French localization by "Artaher Medivh".
v. 11000.4 - 2006/04/17
- Fixed some issues with the tooltip code shared across Fizzwidget addons; Feed-O-Matic's addition to item tooltips should now be able to show up in just about every place you can get an item tooltip.
v. 11000.3 - 2006/04/11
- Feed-O-Matic settings can now be edited via a new Options panel. Typing `/fom` alone shows this panel (the various configuration subcommands, e.g. `/fom alert`, etc., are still available), which controls all aspects of Feed-O-Matic's behavior except for its list of known foods (for now, you'll still need to use slash commands to edit that).
- Additional options are available for warning you that your pet needs feeding: besides flashing the default UI's pet happiness icon, Feed-O-Matic can now also alert you via text message or with the sounds of your pet begging for food. (If you don't like these species-specific pet noises, there's also an option to have a simple bell sound as reminder.)
- You can now click the default UI's pet happiness icon to invoke Feed-O-Matic's feeding function. (This makes three ways to feed your pet with Feed-O-Matic: click the icon, set up a key for Feed Pet in the standard Key Bindings menu, or type or macro `/fom feed`.) Right-click the icon to show the new Options panel.
- Fixed a bug where we could bloat the SavedVariables file when attempting to clean it up upon visiting a stable master. (Now we properly discard data from pets no longer in service.)
- Fixed a bug where we'd still keep trying to feed a food to the pet after finding out it's too low level.
v. 11000.2 - 2006/04/01
- Due to changes in WoW patch 1.10, it's no longer possible for UI addons to feed your pet automatically without direct input; the automatic feeding function is thus no longer available in Feed-O-Matic. You may still find Feed-O-Matic quite useful for its ability to automatically choose foods for your pet and feed them at the touch of a button -- the "Feed Pet" button (configurable in WoW's Key Bindings menu) and `/fom feed` chat/macro command still work just great.
- As an aid to those suffering auto-feed withdrawal, there's now an option for Feed-O-Matic to provide an extra reminder when your pet needs feeding (in case you find the icon next to your pet's health bar too subtle). This is accessed by the same `/fom level` command that previously controlled automatic feeding; when your pet's happiness falls below the specified level, the happiness icon will blink until you feed him enough to sate his hunger.
- Fixed a bug where an error panel could appear when attempting to feed the pet with the `fallback` option turned off and the only foods in your inventory being types you'd prefer to avoid.
- KNOWN BUG: The tooltip additions aren't showing up in all cases where they should. Another update to address this issue should be coming along soon.
v. 11000.1 - 2006/03/28
- Updated for compatibility with WoW patch 1.10. (Minor changes were needed.)
- Should no longer disconnect if you have feed emotes turned on and you try to feed your pet a Legendary item. (Probably not a bug many experienced, but still...)
- Minor improvements to utility code shared across Fizzwidget addons.
- KNOWN BUG: The tooltip additions aren't showing up in all cases where they should. Another update to address this issue should be coming along soon.
See http://fizzwidget.com/notes/feedomatic/ for older release notes.
+25
View File
@@ -0,0 +1,25 @@
<!--
FeedOMatic Runtime Frame Loader (MetaHunt)
Minimal runtime XML without legacy options window definitions.
-->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\..\FrameXML\UI.xsd">
<Frame name="Frame_GFW_FeedOMatic">
<Scripts>
<OnUpdate>
if (MTH_FOM_OnUpdate) then
MTH_FOM_OnUpdate(arg1);
elseif (FOM_OnUpdate) then
FOM_OnUpdate(arg1);
end
</OnUpdate>
</Scripts>
</Frame>
<GameTooltip name="FOMTooltip" frameStrata="TOOLTIP" hidden="true" parent="UIParent" inherits="GameTooltipTemplate">
<Scripts>
<OnLoad>
this:SetOwner(UIParent, "ANCHOR_NONE");
</OnLoad>
</Scripts>
</GameTooltip>
</Ui>