USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.
Simple, easy, useful, Yummy!
UseFood addon script
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Only post additional bot resources here. Please do not ask unrelated questions.
UseFood addon script
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: UseFood addon script
I like it.
I think it could be added to the bot. It can probably be added to the inventory class.
Maybe change the name to something more generic seeing as it can work with anything that applies a buff. Maybe something that implies that it gives a buff. Something like GetBuffFromItem or UseItemForBuff?
What else? ...
We could check player.Casting in case using the item takes time and wait until it's false.
If the user misspells the buff it could waste items. There's not much we can do to check it but we could check to see if the buff was applied after we used the item. If the buff wasn't applied we could print a warning message.
I think it could be added to the bot. It can probably be added to the inventory class.
Maybe change the name to something more generic seeing as it can work with anything that applies a buff. Maybe something that implies that it gives a buff. Something like GetBuffFromItem or UseItemForBuff?
What else? ...
We could check player.Casting in case using the item takes time and wait until it's false.
If the user misspells the buff it could waste items. There's not much we can do to check it but we could check to see if the buff was applied after we used the item. If the buff wasn't applied we could print a warning message.
- 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
Re: UseFood addon script
All valid good great points! Agree totally, and I am flattered you considered this bot material
The not so great news is that I'll be out maybe for a while so won't be able to work on it, If you want to, you may start working on it and apply whatever changes you think are needed like the ones you posted, my cooperation in rom-bot will have to be delayed until next year probably in 1 week time.
Oh yeah and the name , I used "UseFood" because it want meant for foods only, which is the majority use for this, but found it applies to all item/buffs pairs.
My suggestion is to keep the name as simple as possible and it would be: "UseBuffItem" or "UseItemBuff". But even using this name I think there should be an alias to UseFood like:
this could give users some ease of use, since the name is easier to memorize.
Also my script should change variables with names like "food" to "item".
The not so great news is that I'll be out maybe for a while so won't be able to work on it, If you want to, you may start working on it and apply whatever changes you think are needed like the ones you posted, my cooperation in rom-bot will have to be delayed until next year probably in 1 week time.
Oh yeah and the name , I used "UseFood" because it want meant for foods only, which is the majority use for this, but found it applies to all item/buffs pairs.
My suggestion is to keep the name as simple as possible and it would be: "UseBuffItem" or "UseItemBuff". But even using this name I think there should be an alias to UseFood like:
Code: Select all
function UseFood(food,buff)
UseBuffItem(food,buff);
end
Also my script should change variables with names like "food" to "item".
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: UseFood addon script
Ok I'll look into it.
- 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
-
- Posts: 72
- Joined: Thu Mar 08, 2012 7:22 am
Re: UseFood addon script
Is this function in the bot now ?
Re: UseFood addon script
No, probably because the code to do what this function does is so simple. I, and probably many others, just do
or use "UseGoodie" userfunction for the convenience of the code words for the item/buff pairs.
Are you finding some need for a destinct function?
Code: Select all
if not player:hasBuff("buffname") then
inventory:useItem("itemname")
end
Are you finding some need for a destinct function?
- 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
-
- Posts: 72
- Joined: Thu Mar 08, 2012 7:22 am
Re: UseFood addon script
Well, I am farming dog meat (a nice event will coming this week and dog meat will be sell with expensive prices) but I was unable to find who making the bot use house maid potion (lucky powder in fact but also unbridled enthusiasm).
I'll try to add your code on the onLeaveCombat tag.
Ty Rocks
I'll try to add your code on the onLeaveCombat tag.
Ty Rocks
Who is online
Users browsing this forum: No registered users and 7 guests