Download
(3Kb)
Download
Updated: 08-11-09 02:37 PM
Pictures
File Info
Updated:08-11-09 02:37 PM
Created:08-06-09 08:38 AM
Downloads:5,448
Favorites:96
MD5:

Iron Chef  Popular! (More than 5000 hits)

Version: 1.1
by: Wikwocket [More]

== IronChef 1.1 ==
by Wikwocket ([email protected])

Note: This AddOn is not currently being updated. It should still work overall (probably until Cataclysm changes a lot of things). Unfortunately I have not been playing WoW as regularly and I do not have the time to update my AddOns. If you have any questions, please email me at [email protected].

This AddOn equips your Chef's Hat when you open your cooking window. Wearing the Chef's Hat now speeds up your cooking, so this mod will help you wear the appropriate attire when you enter Kitchen Stadium!

When you open your Cooking window, Iron Chef will help by:
* Equipping your Chef's Hat if found (and turning on helm display)
* Changing your title to "Chef" if you are a Chef

When you close the Cooking window, it will restore your hat and title to their pre-cooking values.

Iron Chef will only work properly out of combat, since it has to equip your Chef's Hat. If you're cooking in combat, let's just say you have some bigger fish to fry.

A la cuisine!

I hope you find this mod useful. Feedback and suggestions are always welcome!

Website:
http://wikwocket.wowinterface.com/portal.php

=== Version history: ===

IronChef 1.1 (WoW 3.2):
* Cleaned up item-detection and item-swapping code, for efficiency.
* Added checks to make sure cursor is clear before and after swapping hats.
* Removed redundant print() function.

IronChef 1.0 (WoW 3.2):
* Initial release.

IronChef 1.1 (WoW 3.2):
* Cleaned up item-detection and item-swapping code, for efficiency.
* Added checks to make sure cursor is clear before and after swapping hats.
* Removed redundant print() function.
Optional Files (0)


Post A Reply Comment Options
Unread 11-15-10, 02:51 AM  
nightportier
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
/say ?

Hello.

I will start by just saying i love the addon.

Since i'm proud to be a dwarf with the chefs title i also like to boast about it.

So, my question is, does anybody know how you can get those fantastic messages you see when you equip your hat to show in /say instead of just a message to me?
Would be awsome if it was possible.

Kind regards
Last edited by nightportier : 11-15-10 at 02:53 AM.
Report comment to moderator  
Reply With Quote
Unread 10-18-10, 08:08 AM  
Diftraku
A Kobold Labourer
 
Diftraku's Avatar

Forum posts: 0
File comments: 10
Uploads: 0
I'm more than happy to report that yes, this addon still works, even after being almost obliterated by the Cataclysm (read: 4.0.1 caused no problem what-so-ever regarding the addon).

Installed the addon, opened my Cooking profession and both title and hat equipped, ready to whip up some delicious goodies for the hungry raiders.
__________________
"I remembered I'm not a Satanist. I'm a druid." -House
Report comment to moderator  
Reply With Quote
Unread 06-07-10, 12:37 PM  
Wikwocket
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 61
File comments: 118
Uploads: 8
I wanted to post here that the Iron Chef AddOn is not currently being updated. It should still work overall (probably until Cataclysm changes a lot of things). Unfortunately I have not been playing WoW as regularly and I do not have the time to update my AddOns.

Thank you to everyone who reads or posts in these comments threads, especially to those who have submitted feature ideas and bug fixes. You're the reason the WoW community is so great!
Report comment to moderator  
Reply With Quote
Unread 01-07-10, 01:38 PM  
Beoko
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Constructive Criticism

I was hoping to find an addon to equip my chef's hat while cooking since I can never remember to do it myself. I also noticed from the Change Log that you were looking for efficiency, so I thought I'd help you out somewhat. Given your level of experience from reviewing your coding practices I'm assuming that you may have missed some API and syntax practice which make life much easier. Please don't take this post the wrong way, I do not mean to offend. I do, however, want to see other authors using good code practices. =)

Code:
local function HaveItem(name)
	-- check bags (doesn't check bank or keyring)
	for i = NUM_BAG_FRAMES, 0, -1 do
		for j = GetContainerNumSlots(i), 1, -1 do
			if (GetItemInfo(GetContainerItemLink(i, j) or "") == name) then 
				return true;
			end
		end
	end
	return false;
end
This code would be useful in the absence of GetItemCount. You would still need to check if GetItemCount(46349) > 0 due to lua not equating 0 to nil or false.

Code:
function IronChefFrame.TRADE_SKILL_SHOW()
	-- validate:
	if (GetTradeSkillLine() ~= "Cooking") then return; end -- skill other than cooking
	if IsTradeSkillLinked() then return; end -- someone else's tradeskill
	
	-- if have a Chef's Hat, equip it and prepare for cooking
	if (HaveItem(GetItemInfo(46349))) then
		-- remember old hat info
		oldHatLink = GetInventoryItemLink("player", GetInventorySlotInfo("HeadSlot"));
		if (not oldHatLink) then oldHatLink = ""; end -- no old hat found, assume wearing nothing up top!
		-- if ALREADY wearing Chef's Hat, how stylish! Who are we to question your fashion sense? Exit for now.
		if (GetItemInfo(oldHatLink) == GetItemInfo(46349)) then
			oldHatLink = nil;
			return;
		end
		-- equip toque!
		ClearCursor(); -- ensure cursor is clear
		EquipItemByName(46349);
		ClearCursor(); -- ensure cursor is clear
		-- show it off!
		oldShowHat = ShowingHelm();
		ShowHelm(true);
		-- show "Chef" title!
		if (IsTitleKnown(52)) then
			oldTitle = GetCurrentTitle();
			SetCurrentTitle(52);
		end
		-- let's cook!
		local _, chefsHatLink = GetItemInfo(46349)
		print(chefsHatLink .. " equipped! " .. letsCook[math.random(table.getn(letsCook))]);
		--SendChatMessage(letsCook[math.random(table.getn(letsCook))], "SAY");
	else
		-- no Chef's Hat, how sad! (or already equipped)
		oldHatLink = nil;
	end
end
You could combine the logic and nil checks to form a single if statement which saves a small amount of memory and processing time. Something along the lines of:

Code:
If not IsTradeSkillLinked() and GetTradeSkillLine() == "Cooking" then
You could also replace HaveItem with the aforementioned GetItemCount. Since the numeric slot ID of "HeadSlot" is always 1, you can replace:

Code:
 GetInventoryItemLink("player", GetInventorySlotInfo("HeadSlot"))
with:
Code:
 GetInventoryItemLink("player", 1)
Also:

Code:
if (not oldHatLink) then oldHatLink = ""
This changes oldHatLink to a string if it's nil, which is not needed. In lua, you can nil check variables simply by doing:

Code:
if Variable then -- works if 'Variable' is not nil or false

if not Variable then -- works if 'Variable' is nil or false
Also, you do not have to clear the cursor. I don't think anyone will have an item on their cursor when they open a tradeskill window since it clears the cursor itself to click it =). If you're having issues such as that, it may be due to the changes of EquipItemByName. In 3.3, if you're in combat, it sends the item information to the cursor rather than equipping it. This can be remedied by querying InCombatLockdown.

Code:
if not InCombatLockdown() then -- ClearCursor() no longer needed!
This should be enough information to cover everything. I don't think I missed any other issues. Lastly, here is an example of only equipping or unequipping the chef's hat:

Code:
local AddOn = CreateFrame("Frame")
local Cache

AddOn:RegisterEvent("TRADE_SKILL_SHOW")
AddOn:RegisterEvent("TRADE_SKILL_CLOSE")
AddOn:SetScript("OnEvent", function(self, Event)
	if Event == "TRADE_SKILL_SHOW" and not InCombatLockdown() and not IsTradeSkillLinked() and GetTradeSkillLine() == "Cooking" and GetItemCount(46349) > 0 then
		Cache = GetInventoryItemLink("player", 1)
		EquipItemByName(46349)
	elseif Event == "TRADE_SKILL_CLOSE" and Cache and not InCombatLockdown() then
		EquipItemByName(Cache)
		Cache = nil
	end
end)
-- Note, this keeps the Chef's Hat equipped if you had nothing in your head
-- slot to begin with.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 10-15-09, 07:42 PM  
Wikwocket
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 61
File comments: 118
Uploads: 8
That is rather odd. Are you saying you have the Chef title, but the mod does not display it, and instead displays no title while cooking? If so, can you verify this by turning on display of your own character name and title and then trying it? Thanks!

Originally posted by twinsx2dad
It doesn't give me the "Chef" title. It removes my title, then reinstates it after I close my skill window.
Report comment to moderator  
Reply With Quote
Unread 10-14-09, 12:00 AM  
twinsx2dad
A Defias Bandit

Forum posts: 2
File comments: 3
Uploads: 0
This mod works very well - thank you! - except for one thing...

It doesn't give me the "Chef" title. It removes my title, then reinstates it after I close my skill window.

Not a big deal - the mod does what I need it to do - but tossing up the Chef title would also be nice.
Report comment to moderator  
Reply With Quote
Unread 10-02-09, 12:23 PM  
Sjiulk
A Kobold Labourer

Forum posts: 0
File comments: 35
Uploads: 0
Thank you for making this awesome addon! I'm on the quest for my Sea Turtle mount so I'm cooking up a storm on the side.
Report comment to moderator  
Reply With Quote
Unread 08-31-09, 10:44 AM  
Wikwocket
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 61
File comments: 118
Uploads: 8
Re: Title not working :(

Originally posted by xander1108
I don't have a hat, I only want to switch titles like this mod says it will .. but it doesn't seem to be working. Help?
Right now the mod only tries to swap titles if you also have a hat. I can make it swap titles even if you don't though; I'll add this to the to-do list.
Report comment to moderator  
Reply With Quote
Unread 08-24-09, 10:04 AM  
TuLe
A Black Drake
 
TuLe's Avatar

Forum posts: 87
File comments: 32
Uploads: 0
Turned Altaholic off but the bug persists... Check my char and his awesome chefs hat equiped right now lol


Dam i like this addon so much... but... updates pls!

THX
Last edited by TuLe : 08-26-09 at 04:54 PM.
Report comment to moderator  
Reply With Quote
Unread 08-23-09, 07:54 PM  
TuLe
A Black Drake
 
TuLe's Avatar

Forum posts: 87
File comments: 32
Uploads: 0
Re: Re: Re: german client

Originally posted by Wikwocket
This seems to be the same issue pquayle reported below, where you have a mod that opens your tradeskills when you log out. Maybe it is a mod like altaholic or something, that is making sure it knows what recipes all of your characters know?

At any rate, if you or pquayle can post and let me know which mod does that, I can add a check to Iron Chef so that it does not swap your Chef's Hat in when that mod opens the tradeskill window.
Yes that might ve the case cause im using altaholic as well!
Ill switch off and try it to see if the error persists
Report comment to moderator  
Reply With Quote
Unread 08-19-09, 08:06 AM  
Wikwocket
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 61
File comments: 118
Uploads: 8
Re: Re: german client

Originally posted by TuLe
Whenever i logout from the game the chefs hat is automaticaly equiped..
This seems to be the same issue pquayle reported below, where you have a mod that opens your tradeskills when you log out. Maybe it is a mod like altaholic or something, that is making sure it knows what recipes all of your characters know?

At any rate, if you or pquayle can post and let me know which mod does that, I can add a check to Iron Chef so that it does not swap your Chef's Hat in when that mod opens the tradeskill window.
Report comment to moderator  
Reply With Quote
Unread 08-18-09, 09:51 AM  
TuLe
A Black Drake
 
TuLe's Avatar

Forum posts: 87
File comments: 32
Uploads: 0
Re: german client

Been using this addon on for a week now and i love it BUT... i found a nasty bug. Whenever i logout from the game the chefs hat is automaticaly equiped.. Now whenever i look my armory i got that stylish hat on... Is this fixed now?

Thx
Report comment to moderator  
Reply With Quote
Unread 08-17-09, 09:48 AM  
Slipfoot
A Kobold Labourer

Forum posts: 0
File comments: 11
Uploads: 0
german client

Thx for this great little peace of coding

little tip to get this thing running on german client: edit IronChef.lua and replace on line 43 "Cooking" with "Kochkunst". Enjoy.
Report comment to moderator  
Reply With Quote
Unread 08-12-09, 05:05 PM  
The Merciful
A Kobold Labourer
 
The Merciful's Avatar

Forum posts: 0
File comments: 9
Uploads: 0
Originally posted by Wikwocket
Edit: Version 1.1 is out now, which I hope addresses this issue.
It does. Thank you.
__________________
* Utterly Bastard Groovy *
Report comment to moderator  
Reply With Quote
Unread 08-12-09, 08:13 AM  
Wikwocket
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 61
File comments: 118
Uploads: 8
Originally posted by Gryphon
I have preemptively installed the addon, I am about halfway to getting the chef's hat on my main and other characters are still a little ways off. Would it be possible to check for the achievement first and if not completed do not run the rest of the addon?
I'll look into it. However bear in mind this is a very lightweight addon as it is (2 kb). There are basically 2 functions, one that runs when you open a tradeskill (which immediately bails out if it's not cooking or you don't have a Chef's Hat), and one that runs when you close a tradeskill.

In adding such a check, I would have to be careful not to add more memory usage than I am saving!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: