Page 2 of 3

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 11:25 am
by JackBlonder
Did you use the potion id? This would explain the result.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 11:36 am
by Giram
Yes. Do i need to use buff id or what?

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 11:44 am
by JackBlonder
Of course.
TEXT('SysXXXXXX_name') returns the string of id XXXXXX.
If you want the name of your buff you have to use the id of your buff.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 1:51 pm
by Giram
I managed to get id from few buff. Is there there other place to find buff id than UnitBuff function?

But i need little help with this one. I don't totally understand those variables in jduartedj code or how that works. I tried this but not sure if i did that right and I don't know where that should romscript should be placed.

Code: Select all

speed = {ID = 207200, buffName = 506684, castTime = 0}
option.buffName = RoMScript("TEXT('Sys"..option.buffName.."_name')")

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 3:15 pm
by JackBlonder
I didn't look into his code yet but I think instead of

Code: Select all

luck = {ID = 207203, buffName = "Gl\129ckspuderstaub", castTime = 0}
you could use

Code: Select all

luck = {ID = 207203, buffName = RoMScript("TEXT('SysXXXXXX_name'), castTime = 0}
You can get IDs from the game's data.fdb file (extract it,find string_xx.db).

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 3:42 pm
by Giram

Code: Select all

speed = {ID = 207200, buffName = RoMScript("TEXT('Sys506684_name')"), castTime = 0}, -- Unbridled Enthusiasm
That is not working. I get error: script\bot.lua:32: ...:/pelit/Runes Of Magic/micromacro/scripts/macros.lua:85: Macro number needs to be between 1 and 49.

Also i get same error if i use variable on table. I think it might be missing some brackets or some other character.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 7:10 pm
by rock5
Use this to get all buff ids of current buffs/

Code: Select all

/script i=1 while UnitBuff("player",i) ~= nil do nn,__,__,ii = UnitBuff("player",i) SendSystemChat(nn..", "..ii) i = i+1 end

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Feb 10, 2011 7:17 pm
by rock5
Giram wrote:That is not working. I get error: script\bot.lua:32: ...:/pelit/Runes Of Magic/micromacro/scripts/macros.lua:85: Macro number needs to be between 1 and 49.
That sounds like 1 of my error messages from macro.lua. I don't know how that got triggered. Do other RoMScript commands work? Did you move your macros around or something?

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Feb 11, 2011 2:08 am
by Giram
Other romscripts does work but that error came when i placed romscript inside table. Didn't do anything with macros.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Feb 11, 2011 4:11 am
by rock5
I know what the problem is. That variable, itemTable, is declared outside of any function so it gets run when the file gets loaded. The usersfunctions get loaded before the macros are defined so the RoMScipt doesn't work.

Try putting it in the function with a check to make it run only once

Code: Select all

function useGoodie(_itemName,_buffName) --ofc I came up with a silly name
	itemTable = itemTable or {
		 ...
		 speed = {ID = 207200, buffName = RoMScript("TEXT('Sys506684_name')"), castTime = 0}, -- Unbridled Enthusiasm
		 ...
	}
-- the rest if the function
end
Then you should have no problem.

Mind you, another better way to get the buff name from the id is

Code: Select all

GetIdName(buffid)
this doesn't use RoMScript but instead uses the memorytables so it's a lot faster.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Feb 11, 2011 7:19 am
by Giram
I think i got it working. I got all potion id's so i hope there is not problem using those but i am missing some food buff id's.

Code: Select all

--lvl 1-20
pdmg = {ID = 207209, buffName = "Salted Fish with Sauce", castTime = 0},
mdmg = {ID = 207210, buffName = "Smoked Bacon with Herbs", castTime = 0},
--lvl 21-40
critp = {ID = 207211, buffName = "Caviar Sandwich", castTime = 0},
matt = {ID = 207212, buffName = "Deluxe Seafood", castTime = 0}, --guessed
--lvl 81-100        
patt3 = {ID = 207215, buffName = "Unimaginable Salad", castTime = 0}, 
matt3 = {ID = 207216, buffName = "Cheese Fishcake", castTime = 0} --guessed
So if someone has these foods and could use this script below for example to get id and post it so i can add it.

Code: Select all

/script i=1 while UnitBuff("player",i) ~= nil do nn,__,__,ii = UnitBuff("player",i) SendSystemChat(nn..", "..ii) i = i+1 end
This version should work for all languages.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Feb 11, 2011 8:35 am
by rock5
You could probably use ItemPreview addon for good guesses at those buff names.

Example: I looked up Caviar Sandwich and got 4 likely results. Only one of them had an id close to those other foods. That's 506675.

Hope that helps.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Wed Feb 16, 2011 9:29 am
by Giram
I changed rest buff names with buff id's and uploaded new version of it.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Mon Feb 28, 2011 8:21 am
by Rom Botter
wow, so much work on a user function...

i always just assign a skill i never use to my hotkey, change cooldown to cooldown of potion, and let the bot use that tweaked skill as a potion :)

but then again, i dont use that many potions :P

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Apr 21, 2011 9:14 am
by nokirk
doesn't work for me unfortunately.

Called it with

Code: Select all

useGoodie(speed);
in the <onLeaveCombat> section, but I always get the same error
.../Documents/micromacro/scripts/rom/classes/player.lua:1254: Fehler im Profile
bei der Zeitpunktverarbeiten: onLeaveCombat error ...ipts/rom/userfunctions/addo
n_useGoodie_universal.lua:51: attempt to index local 'option' (a nil value)
any idea?

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Apr 21, 2011 9:54 am
by rock5
It would have to be

Code: Select all

useGoodie("speed");
wouldn't it?

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Apr 21, 2011 5:47 pm
by nokirk
rock5 wrote:It would have to be

Code: Select all

useGoodie("speed");
wouldn't it?
yes, thank you.

Now it keeps throwing the potions, so the buff doesn't get recognised. I guess I'll just go for Rom Botters idea misusing a skill and increase the cooldown accordingly :D

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Thu Apr 21, 2011 11:01 pm
by rock5
What do you mean, it keeps 'throwing' the potion?

If it's not recognising the buff you could try a more manual approach,

Code: Select all

useGoodie(207200, "Unbridled Enthusiasm")
Note: That's the english name for the buff. It would have to be in your own language.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Apr 22, 2011 6:12 am
by Giram
nokirk wrote: Now it keeps throwing the potions, so the buff doesn't get recognised. I guess I'll just go for Rom Botters idea misusing a skill and increase the cooldown accordingly :D
Are you using latest function i did? Not the one on the first page. I tried to make it work for all by not using buff names but it would get those names from client so it would work for all languages.

I have been using that everytime i need to use housemaid stuff. I haven't got much feedback from players who don't use english client so i don't know how it works for others.

Re: UseFood + useHousemaidPotions = useGoodie !!!

Posted: Fri Apr 22, 2011 6:36 am
by rock5
Why didn't you update the first post?

And why don't you add this to the repository?