Page 1 of 1

House maid potions and food

Posted: Mon Dec 20, 2010 6:16 pm
by fethi
We r using bot for collecting so it would be great to use speed and droprate potions of house maid. İ tried to write it as a skill but its not always working right especially when out of pot it gives error and somethimes bot disconnect or wait long after this error. So is there anyother way for it ??

Re: House maid potions and food

Posted: Mon Dec 20, 2010 6:47 pm
by Alkaiser
Someone on these forums already made a function for housemaid potions and food. I can't seem to find the post in question, so I'll post what I'm using here:

Code: Select all

-- Examples
-- useHousemaidPotions("speed");
-- useHousemaidPotions("castspeed");
-- useHousemaidPotions("frog");
-- useHousemaidPotions("luck");
-- useHousemaidPotions("MeatsauceBurrito");
-- useHousemaidPotions("caviarSandwich");
-- useHousemaidPotions("saltedFish");

function useHousemaidPotions(_potionName)

	-- [Housemaid crafting potions] --
	if _potionName == "speed" then
		local potID = 207200; -- Unbridled Enthusiasm
		local buffName = "Unbridled Enthusiasm";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			inventory:update();
			yrest(750);
		end
	end
	
	if _potionName == "castspeed" then
		local potID = 207202; -- Clear Thought
		local buffName = "Clear Thought";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			yrest(1000);
			inventory:update();
			yrest(750);
		end
	end
	
	if _potionName == "frog" then
		local potID = 207201; -- Princely Look
		local buffName = "Princely Look";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			yrest(1000);
			inventory:update();
			yrest(750);
		end
	end

	if _potionName == "luck" then
		local potID = 207203;	-- Luck Powder Dust
		local buffName = "Turn of Luck Powder Dust";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			inventory:update();
			yrest(750);
		end
	end
	
	-- [Housemaid cooking potions] --
	if _potionName == "MeatsauceBurrito" then
		local potID = 207213; -- Special Spicy Meatsauce Burrito
		local buffName = "Spicy Meatsauce Burrito";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			inventory:update();
			yrest(750);
		end
	end
	
	if _potionName == "caviarSandwich" then
		local potID = 207211;
		local buffName = "Caviar Sandwich";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			inventory:update();
			yrest(750);
		end
	end
	
	if _potionName == "saltedFish" then
		local potID = 207209;
		local buffName = "Salted Fish with Sauce";
		
		if not player:hasBuff(buffName) and inventory:itemTotalCount(potID) >= 1 then
			inventory:useItem(potID);
			inventory:update();
			yrest(750);
		end
	end
end
Save this as addon_housemaidPotions.lua and put it in the userfunctions folder.

Re: House maid potions and food

Posted: Wed Dec 22, 2010 6:27 am
by Starrider
and where to load it in the profile.xml?
onload? or after leavecombat?

Re: House maid potions and food

Posted: Thu Dec 23, 2010 6:26 pm
by Alkaiser
Either would work. Leave combat would probably be better. I have them in my waypoint file, rather than my profile.

Re: House maid potions and food

Posted: Sat Jan 01, 2011 6:27 pm
by Giram
My latest file for using those potions and foods.

Re: House maid potions and food

Posted: Sat Jan 01, 2011 7:25 pm
by jduartedj
You should post this under addons

Re: House maid potions and food

Posted: Sun Jan 02, 2011 3:20 am
by rock5
jduartedj wrote:You should post this under addons
Yes, create a dedicated post for the addon in the addons section. You can even add it to the wiki repo.