housemaid potions and foods

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

housemaid potions and foods

#1 Post by Giram » Fri Jan 14, 2011 12:24 pm

This addon helps using potions and foods got from housemaids.

These lines can be placed for example in onLeaveCombat so it will use it after combat.

Code: Select all

useHousemaidPotions("speed");
useHousemaidPotions("frog");
useHousemaidPotions("luck");
useHousemaidPotions("clearThought");
useHousemaidPotions("crazyBreakout");
useHousemaidPotions("fullness");
useHousemaidPotions("gallopingGale");
useHousemaidPotions("MeatsauceBurrito");
useHousemaidPotions("caviarSandwich");
useHousemaidPotions("saltedFish");
useHousemaidPotions("deliciousSwampMix");
useHousemaidPotions("unimaginableSalad");
useHousemaidPotions("cheeseFishcake");
If some potion / food is missing you can post it and i update this addon. Just need name of the buff and the name of potion.
Attachments
addon_housemaidPotions_V3.lua
(1.72 KiB) Downloaded 258 times
Last edited by Giram on Fri Jan 14, 2011 8:43 pm, edited 1 time in total.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: housemaid potions and foods

#2 Post by rock5 » Fri Jan 14, 2011 8:16 pm

Can I make a small suggestion? Instead of

Code: Select all

			if not player:hasBuff(option.buffName) and inventory:itemTotalCount(option.potID) >= 1 then
use

Code: Select all

			if inventory:itemTotalCount(option.potID) >= 1 and not player:hasBuff(option.buffName)  then
That way, if you don't have the potion you save half a second that hasBuff would have taken to execute. hasBuff takes time to execute because it uses RoMScript().
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: housemaid potions and foods

#3 Post by Giram » Fri Jan 14, 2011 8:53 pm

Code has been optimized.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: housemaid potions and foods

#4 Post by jduartedj » Sat Jan 15, 2011 9:58 am

Looks a lot like my UseFood() function but with a table! Seems nice. Maybe we could merge the two and submit for adding to the bot like i discussed with rock5 in my thread?
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: housemaid potions and foods

#5 Post by Giram » Sat Jan 15, 2011 11:25 am

I don't mind merging our works and it would be nice if my work will improve bot :)

But still i am not sure if this contains all potions / foods if it matters.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: housemaid potions and foods

#6 Post by jduartedj » Sat Jan 15, 2011 11:41 am

Giram wrote:I don't mind merging our works and it would be nice if my work will improve bot :)

But still i am not sure if this contains all potions / foods if it matters.
We can look it up and include every housemaid pots/foods in the table including useless ones (go figure why but some people might wanna use them), also merging with mine would allow support for any item as long as it is user input, like UseFood(item,buff) (see my function for details).

Anyway I'm gonna have a look at both code and post a merge suggestion with a file, Then you can look at it and make your own suggestions and so on... ok?
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: housemaid potions and foods

#7 Post by Giram » Sat Jan 15, 2011 11:59 am

Post your work when you combine these.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: housemaid potions and foods

#8 Post by rock5 » Sat Jan 15, 2011 1:21 pm

You should do the table like this?

Code: Select all

itemTable ={
			speed = {potID = 207200, buffName = "Unbridled Enthusiasm", castTime = 0},
			frog = {potID = 207201, buffName = "Princely Look", castTime = 1000},
			luck = {potID = 207203, buffName = "Turn of Luck Powder Dust", castTime = 0},
			clearThought = {potID = 207202, buffName = "Clear Thought", castTime = 0},
			crazyBreakout = {potID = 207205, buffName = "", castTime = 1000},
			fullness = {potID = 207199, buffName = "Fullness", castTime = 0},
			gallopingGale = {potID = 207204, buffName = "Galloping Gale", castTime = 0},
			MeatsauceBurrito = {potID = 207213, buffName = "Spicy Meatsauce Burrito", castTime = 0},
			caviarSandwich = {potID = 207211, buffName = "Caviar Sandwich", castTime = 0},
			saltedFish = {potID = 207209, buffName = "Salted Fish with Sauce", castTime = 0},
			deliciousSwampMix = {potID = 207214, buffName = "Delicious Swamp Mix", castTime = 0},
			unimaginableSalad = {potID = 207215, buffName = "Unimaginable Salad", castTime = 0},
			cheeseFishcake = {potID = 207215, buffName = "Cheese Fishcake", castTime = 0}
			}
That way you don't have to search for the values.

Code: Select all

function useHousemaidPotions(_potionName)
	local option = itemTable[_cName]
	if option and inventory:itemTotalCount(option.potID) >= 1 and not player:hasBuff(option.buffName) then
		inventory:useItem(option.potID);
		
		if option.castTime > 0 then
			yrest(option.castTime);
		end
		
		inventory:update();
		yrest(750);
	end
end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: housemaid potions and foods

#9 Post by jduartedj » Sun Jan 16, 2011 10:58 pm

Like I promised this is my suggestion:
useGoodie
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

j19861986
Posts: 37
Joined: Sun Jan 16, 2011 1:01 am

Re: housemaid potions and foods

#10 Post by j19861986 » Tue Mar 08, 2011 10:42 pm

You forgot "Godspeed" potion from Crafting Maid and "Scarlet Love" Potion from Crafting Maid... that is for my needs
I still haven't checked buffname yet, so I leave it empty, will add the Buffname later...
look in code and tell me if it is correct

Code: Select all

[13] = {optionName = "cheeseFishcake", potID = 207215, buffName = "Cheese Fishcake", castTime = 0},
[14] = {optionName = "godspeed", potID = 207208, buffName = "", castTime = 0},
[15] = {optionName = "scarletlove", potID = 207206, buffName = "", castTime = 0}
}

User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: housemaid potions and foods

#11 Post by Giram » Wed Mar 09, 2011 9:09 am

This project has been combined with jduartedj work. Newest version can be downloaded from this link:

http://www.solarstrike.net/phpBB3/viewt ... 949#p18949

To use that you need to use another command. for example:

Code: Select all

useGoodie("speed");

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests