useGoodie
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.
Re: useGoodie
can you show me how you write in the code, do you need to put (;) after the code (useGoodie"luck")?
Re: useGoodie
In Lua code semicolons are optional i think. But you still need to form functions correctly. useGoodie("luck").harbifm wrote:can you show me how you write in the code, do you need to put (;) after the code (useGoodie"luck")?
Re: useGoodie
I've been having trouble using this file so I've done some work on it to make it more reliable.
Changes:
Changes:
- 1. Because it looks like GetIdName often doesn't work the first time you apply the buff, I've added a RoMScript command to get the name as a backup.
2. I thought it was a bad idea to get all the buff names every time you use the function so I've changed it to only get the buff name when it's first needed. That means the buffnames are originally saved as ids only.
3. I've added a check to make sure it has a buff name before trying to see if you have the buff so you shouldn't get anymore errors.
4. I've updated all the buff ids for the 1-40 buffs. I'm not sure why some of the ones I changed said they were tested. Maybe older clients use different buff ids? That probably needs to be confirmed.
- Attachments
-
- userfunction_useGoodie_universal.lua
- (3.71 KiB) Downloaded 913 times
- 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: useGoodie
I just thought users of this addon would be interested. There has been a lot a problems in the past with the buff ids used in this addon not being exactly the right one. Well as of rombot revision 613 these should be a thing of the past. The bots buff functions no longer directly compare ids anymore but instead compare the names gotten from the ids. That means as long as the id gives the right name then it will work. The id doesn't have to be exactly the right one.
Read more 613 changelog
Read more 613 changelog
- 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: useGoodie
UseGoodie not working anymore, Buff check works, it says casting but does not.
so i guess
is disabled/broken in Patch
so i guess
Code: Select all
inventory:useItem(option.ID);
Re: useGoodie
I got a fix working that should solve all RoMScript problems. Just testing and cleaning up code.
- 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: useGoodie
you don't know how glad I am to hear that, I have been putting off changing all my profiles from MACRO to keys lolrock5 wrote:I got a fix working that should solve all RoMScript problems. Just testing and cleaning up code.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: useGoodie
I'd liek to personally Thank Giram for continuing the development of my original userfunction, useGoodie() keep it up and keep the credits, just mention me.
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
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: useGoodie
heyas,
I made some changes to rocks version of this a while back and have been meaning to post it in case anyone finds it useful. I'm inherently lazy so I tend to write more code to allow me to write less .
The code below are the comments from the top of the file explaining its usage:
I made some changes to rocks version of this a while back and have been meaning to post it in case anyone finds it useful. I'm inherently lazy so I tend to write more code to allow me to write less .
The code below are the comments from the top of the file explaining its usage:
Code: Select all
-- All this does is allow you to use the 'standard' buffs a bit easier, and with less code :)
-- However, I've sacrificed readability a bit for this, as you will see in the example below:
-- buffUp(true, true, false, true, false, true, false, determineFoodTypeToBuff());
--
-- Pretty cryptic huh? Well, the function buffUp is defined like this:
-- buffUp(luck, speed, mountSpeed, casting, jump, defense, aggro, foodType)
--
-- So, the parameters it takes are:
--
-- ---------------------------------------------
-- Parameter | Details
-- ---------------------------------------------
-- luck | use luck pot? true/false
-- speed | use running speed pot? true/false
-- mountSpeed | use mount speed pot? true/false
-- casting | use casting pot? true/false
-- jump | use jump pot? true/false
-- defense | use defense pot? true/false
-- aggro | use aggro generation pot? true/false
-- foodType | what type of food to use? * For this one I wrote a helper function to
-- determine if you want Physical/Magic enhancing food - this is called
-- determineFoodTypeToBuff() and will choose it based on your primary
-- class only. Otherwise specify SPECIAL_TYPES_PHYSICAL for physical food
-- or SPECIAL_TYPES_SPELL for magical food.
-- ---------------------------------------------
--
-- so in my original example, if I am a scout/mage:
-- buffUp(true, true, false, true, false, true, false, determineFoodTypeToBuff());
-- will use luck pots, speed pots, casting pots, defense pots, and a physical food.
------------------------------------------------
- Attachments
-
- userfunction_useGoodie_universal.lua
- (10.64 KiB) Downloaded 291 times
Re: useGoodie
I wouldn't call it my function. Actually, I don't remember contributing anything except for maybe pointing out a few things.BillDoorNZ wrote:I made some changes to rocks version of this a while back
Edit: Oh look, I did post a version. I forgot all about it. My memory is not what it used to be.
- 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: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: useGoodie
lol...you must have been in the zone when you did that
the gods only know how often I've written code I cant remember writing
or, I deny writing anyway
the gods only know how often I've written code I cant remember writing
or, I deny writing anyway
Re: useGoodie
yup your getting old, all down hill from hererock5 wrote:Edit: Oh look, I did post a version. I forgot all about it. My memory is not what it used to be.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: useGoodie
the plus side of that of course, is that its much easier going downhill ';)lisa wrote:yup your getting old, all down hill from hererock5 wrote:Edit: Oh look, I did post a version. I forgot all about it. My memory is not what it used to be.
Re: useGoodie
I got it working after i put the newest userfunction_usegoodie file in my interface/addons/userfunctions folder.
Re: useGoodie
I added these to the table, and tested, work fine:
I got the codes from the getbuffed site, ie: http://romdata.getbuffed.com/item/list/2.2
Cheers
Code: Select all
--XP/TP buff items
xpcake = {ID = 202895, buffName = 850473, castTime = 0}, -- wedding cake (+xp/tp)
xppot = {ID = 201134, buffName = 201134, castTime = 0}, -- normal Experience Potion
tppot = {ID = 201610, buffName = 201610, castTime = 0}, -- normal Skill Potion
Cheers
Re: useGoodie
Hi everyone,
Did the food part function works for you ?
everything works great except food for me.
I am currently using the "buffup" part from BillDoorNZ
I have try to verify and change IDs if needed for one food:
Housekeeper Special Unimaginable Salad
foodname:207215
Buffname: 506679
but nothing change
(sorry for my english, not native )
Did the food part function works for you ?
everything works great except food for me.
I am currently using the "buffup" part from BillDoorNZ
I have try to verify and change IDs if needed for one food:
Housekeeper Special Unimaginable Salad
foodname:207215
Buffname: 506679
but nothing change
(sorry for my english, not native )
Re: useGoodie
How are you using the function? Are you using the determineFoodTypeToBuff() helper function or are you using the SPECIAL_TYPES_PHYSICAL variable?
I think this part of buffUp is wrong.It should probably be
Notice the quotes arround the strings.
I think this part of buffUp is wrong.
Code: Select all
if (foodType) then
if (foodType == SPECIAL_TYPES_SPELL) then
if (countGoodie(matt3) > 0) then
useGoodie(matt3);
elseif (countGoodie(mdmg2) > 0) then
useGoodie(mdmg2);
elseif (countGoodie(matt) > 0) then
useGoodie(matt);
elseif (countGoodie(mdmg) > 0) then
useGoodie(mdmg);
else
printf("Count not apply spell food buff as you do not have any spell food!\n");
end;
elseif (foodType == SPECIAL_TYPES_PHYSICAL) then
if (countGoodie(patt3) > 0) then
useGoodie(patt3);
elseif (countGoodie(patt2) > 0) then
useGoodie(patt2);
elseif (countGoodie(critp) > 0) then
useGoodie(critp);
elseif (countGoodie(pdmg) > 0) then
useGoodie(pdmg);
else
printf("Count not apply physical food buff as you do not have any physical food!\n");
end;
else
printf("An invalid food type was specified for the buffUp function, should be physical/spell (1 and 2 respectively)\n");
end;
end;
Code: Select all
if (foodType) then
if (foodType == SPECIAL_TYPES_SPELL) then
if (countGoodie("matt3") > 0) then
useGoodie("matt3");
elseif (countGoodie("mdmg2") > 0) then
useGoodie("mdmg2");
elseif (countGoodie("matt") > 0) then
useGoodie("matt");
elseif (countGoodie("mdmg") > 0) then
useGoodie("mdmg");
else
printf("Count not apply spell food buff as you do not have any spell food!\n");
end;
elseif (foodType == SPECIAL_TYPES_PHYSICAL) then
if (countGoodie("patt3") > 0) then
useGoodie("patt3");
elseif (countGoodie("patt2") > 0) then
useGoodie("patt2");
elseif (countGoodie("critp") > 0) then
useGoodie("critp");
elseif (countGoodie("pdmg") > 0) then
useGoodie("pdmg");
else
printf("Count not apply physical food buff as you do not have any physical food!\n");
end;
else
printf("An invalid food type was specified for the buffUp function, should be physical/spell (1 and 2 respectively)\n");
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
Re: useGoodie
I am using the determineFoodTypeToBuff() by default for a physical
-> does not work
I tried determineFoodTypeToBuff(1) to force physical, as describe in the comment;
--helpers
SPECIAL_TYPES_PHYSICAL = 1;
SPECIAL_TYPES_SPELL = 2;
-> does not work
I haven't tried yet the SPECIAL_TYPES_PHYSICAL
I am going to modify the script as you preconized, and test it
will come back and tell you what
-> does not work
I tried determineFoodTypeToBuff(1) to force physical, as describe in the comment;
--helpers
SPECIAL_TYPES_PHYSICAL = 1;
SPECIAL_TYPES_SPELL = 2;
-> does not work
I haven't tried yet the SPECIAL_TYPES_PHYSICAL
I am going to modify the script as you preconized, and test it
will come back and tell you what
Re: useGoodie
Test done
result: your modification helps a lot to find another problem in line 204: foodtype wasn't defined
I have modified
in
and tested the buffup function with "SPECIAL_TYPES_PHYSICAL" and..
It's working !!!!
It use the Housekeeper Special Unimaginable Salad now.
thanks a lot for that.
Another question, in the game we can have both Patt3 and Critp but in the script it is not possible with the "elseif"
Is it possible to use an "and" (or something else ?) instead of the "elseif" regarding lines 216 to 222:
MOdified file working for food
result: your modification helps a lot to find another problem in line 204: foodtype wasn't defined
I have modified
Code: Select all
if (foodType) then
Code: Select all
if (foodType == SPECIAL_TYPES_SPELL) then
and tested the buffup function with "SPECIAL_TYPES_PHYSICAL" and..
It's working !!!!
It use the Housekeeper Special Unimaginable Salad now.
thanks a lot for that.
Another question, in the game we can have both Patt3 and Critp but in the script it is not possible with the "elseif"
Is it possible to use an "and" (or something else ?) instead of the "elseif" regarding lines 216 to 222:
Code: Select all
elseif (foodType == SPECIAL_TYPES_PHYSICAL) then
if (countGoodie("patt3") > 0) then
useGoodie("patt3");
elseif (countGoodie("patt2") > 0) then
useGoodie("patt2");
elseif (countGoodie("critp") > 0) then
useGoodie("critp")
- Attachments
-
- userfunction_useGoodie_universal.lua
- Mdified file working for food :)
- (10.8 KiB) Downloaded 216 times
Re: useGoodie
I think you messed it up. It was like this. (pseudo code following)
What this means is, if a foodtype was specified then, if it was spell type then use spell stuff, else if physical was specified then use physical. If foodtype was specified but is neither spell nor physical then an incorrect value was specified, print an error message. The way you've written it it looks like it will print the error message even if the foodtype wasn't specified, which is wrong.
As to your other question, I think it should only use 'else' when you want it to use one or another item. If you want it to check all appropriate foods, it should only use 'if's, no 'else's. Eg.In this example it will use patt3 or patt2 then also check critp.
Code: Select all
if foodtype then
if foodtype == TYPE_SPELL then
-- use spell type goodies.
if foodtype == TYPE_PHYSICAL then
-- use physical goodies.
else
-- must have used an invalid value for 'foodtype'
end
end
As to your other question, I think it should only use 'else' when you want it to use one or another item. If you want it to check all appropriate foods, it should only use 'if's, no 'else's. Eg.
Code: Select all
if (countGoodie("patt3") > 0) then
useGoodie("patt3");
elseif (countGoodie("patt2") > 0) then
useGoodie("patt2");
end
if (countGoodie("critp") > 0) then
useGoodie("critp");
- 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
Who is online
Users browsing this forum: No registered users and 4 guests