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
is there an old version, may 6-7 months old.
I would like to give it a try
I would like to give it a try
Re: useGoodie
Default folder for userfunctions is micromacro\scripts\rom\userfunctions . But since you need to use older version of rombot the rombot might not be able to use these files. I think it was addons folder at first.harbifm wrote:did not work
where should I save the file (userfunction_useGoodie_universal .lua)?
You can't use different name for function in code. That is always useGoodie("item_name or ID"); . As for file name there should be userfunction or addon in front of the name. Otherwise bot won't recognice these files.harbifm wrote:
I have put into the script ffolder, not the profile folder. shouldl I rename the lua file to (usergoodie) for the bot to recongnize it since it is named that in the code, not userfunction_useGoodie_universal.lua, or the other way around
what I meen is changeing the name as an example (useGoodie ("speed"); to (userfunction_useGoodie_universal "speed"); in the profile code?
and again where to save it for the bot to recongnize it?
If you have english client then you can try http://www.solarstrike.net/phpBB3/viewt ... =27&t=2051 . That is oldest i can give now. In code there is english buff names so if your clients language is not english then it won't work.harbifm wrote:is there an old version, may 6-7 months old.
I would like to give it a try
Re: useGoodie
the proplem that I have is that the rom folder does have either addons or userfunctions folders,
I create them manualy,still the bot did not recongnize them but still , it did not work.
i update to newer version (545), which has the userfucntions folder, but then rombot did not work,,my version is 468
is there a solution
I create them manualy,still the bot did not recongnize them but still , it did not work.
i update to newer version (545), which has the userfucntions folder, but then rombot did not work,,my version is 468
is there a solution
Re: useGoodie
I don't know the version that introducted addons or userfunctions. So it might be that you have too old version of rombot for userfunctions. Creating folders won't work cause rombot won't have code to find those folders and use files in them.
Because you play with older version or runes of magic and are forced to use older version you might not be able to use these files directly. I don't know what functions you are able to use but you can still use code in profile or waypoints.
You could try something like this:
To get buff name use item you want that gives you buff. Check that name and enter it exactly as you see it in hasBuff() function. Then in useItem() function write item you wan't to use. That can also accept item ID but then you can't use semicolons i think. It might work or then it won't work. I am also using much newer version of runes of magic and this is done for newest version. I can only give hints how you can do this but can't be sure if it will work. Depends of the functions your rombot has at the moment. Hope you can get something to work.
You can place that code in your profile between onLeavecombat, onPreSkillCast, onSkillCast or in waypoint file. Profile settings also depends from your rombot version. I don't know at wich versions those are implemented in rombot.
Because you play with older version or runes of magic and are forced to use older version you might not be able to use these files directly. I don't know what functions you are able to use but you can still use code in profile or waypoints.
You could try something like this:
Code: Select all
if not player:hasBuff("write_buff_name_here") then
inventory:useItem("write_item_name_here")
end
You can place that code in your profile between onLeavecombat, onPreSkillCast, onSkillCast or in waypoint file. Profile settings also depends from your rombot version. I don't know at wich versions those are implemented in rombot.
Re: useGoodie
Please note that in older versions, player:hasBuff didn't use the memory, it used RoMScript commands. So you might find it slows things down too much if used in certain places.
- 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
so the code should read like this:
<onLeaveCombat>
if not player:hasBuff("luck") then
inventory:useItem("XXX")
end
if not player:hasBuff("1200 elemental damage") then
inventory:useItem("XXX")
end
</onLeaveCombat>
<onLevelup><![CDATA[
-- Additional Lua code to execute after having a levelup
-- and levelup the skills for a new character (mage or priest recommended)
-- e.g. sendMacro("SetSpellPoint(_tabnr, _skillnr);"); would levelup a skill
]]></onLevelup>
where luck and 1200 elemental damage are the effect/buff name, and XXX are the items name. should not that be a number for each item?
<onLeaveCombat>
if not player:hasBuff("luck") then
inventory:useItem("XXX")
end
if not player:hasBuff("1200 elemental damage") then
inventory:useItem("XXX")
end
</onLeaveCombat>
<onLevelup><![CDATA[
-- Additional Lua code to execute after having a levelup
-- and levelup the skills for a new character (mage or priest recommended)
-- e.g. sendMacro("SetSpellPoint(_tabnr, _skillnr);"); would levelup a skill
]]></onLevelup>
where luck and 1200 elemental damage are the effect/buff name, and XXX are the items name. should not that be a number for each item?
Re: useGoodie
by the way, why not copy the whole code into (userfuction.lua) and doing the same thing?
will that work?
will that work?
Re: useGoodie
because userfunction.lua has the core functions for the bot to run. The userfunctions folder was implemented so people can make their own functions without edited the core files of the bot. each time the bot is updated people would need to redo their code again and again. With the usage of the userfunctions folder there is no need for that.
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
the problem with my version is that there is no userfucntions or addon folder
why not add the code to the user fucntion at the end, and call it in my profie. (for my case)
I can back-up the userfuction folder if need later for updating my rombot
they way that I am going to do it is to cut and past all the content of usergoodie and catch cavi to the userfuntion.lua at the end of every thing, so it does interept any thing, and try to put actions after onLeaveCompat for it to catch golden cavi, use luck potion and Swamp delcious salad every time a compat finish.
I only need these items
why not add the code to the user fucntion at the end, and call it in my profie. (for my case)
I can back-up the userfuction folder if need later for updating my rombot
they way that I am going to do it is to cut and past all the content of usergoodie and catch cavi to the userfuntion.lua at the end of every thing, so it does interept any thing, and try to put actions after onLeaveCompat for it to catch golden cavi, use luck potion and Swamp delcious salad every time a compat finish.
I only need these items
Re: useGoodie
I would probably just create a file, let's call it "MyFunctions.lua", and put all my functions in there. Then just add the one line to functions.lua,
Or maybe you could avoid editing functions.lua and put that command in your profile <onload> instead.
Code: Select all
include("MyFunctions.lua")
- 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
as I understood it
function.lua contain a list of fucntions.
if i add any thing there, as long as added and do not scrow the sequence in the middle, and that it is already have been set in the system (profile) ,or what ever sitting there are, to use funtions.lua for any comand (or look into it there)
like if a called on somthing listed there, as example, if I copy the all the code from Addon_catchcavi.xml, into the functions.lua and I use the following:
<onLeaveCompat>
catchcavi();)
</onLeaveCompat>
it will look for catchcavi() from the funtions.lua file and use it, why add another loop into the function.lua file?
function.lua contain a list of fucntions.
if i add any thing there, as long as added and do not scrow the sequence in the middle, and that it is already have been set in the system (profile) ,or what ever sitting there are, to use funtions.lua for any comand (or look into it there)
like if a called on somthing listed there, as example, if I copy the all the code from Addon_catchcavi.xml, into the functions.lua and I use the following:
<onLeaveCompat>
catchcavi();)
</onLeaveCompat>
it will look for catchcavi() from the funtions.lua file and use it, why add another loop into the function.lua file?
Re: useGoodie
Another reason is for troubleshooting, since your version is so old I am guessing there will be a lot of problems that arise, if you keep the original files in tact it is a lot easier for us to try and help fix the issues. Adding a single line to the top of the file which says to include another file is a good way to go about it.
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
Like I said in the other post, put all your functions, such as the catchcavy function, into the userfunction.lua file. It wont initially exist, just create it in the rom folder and add the functions. That way, like Lisa said, you don't need to modify any of the original files. Note: the userfunctions.lua file was created specifically for this purpose, use 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
Re: useGoodie
ok
I created a userfunctions.lua,
I put the code for catch cavi and useGoodies into it.
and wrote this into the profile, tell me if am doing something wrong
<onLoad><![CDATA[
<include("userfunctions.lua");
-- Additional Lua code to execute after loading the profile
-- and before the bot starts. e.g. You could overwrite profile settings here
-- like: changeProfileOption("HP_REST", 60);
]]></onLoad>
I created a userfunctions.lua,
I put the code for catch cavi and useGoodies into it.
and wrote this into the profile, tell me if am doing something wrong
<onLoad><![CDATA[
<include("userfunctions.lua");
-- Additional Lua code to execute after loading the profile
-- and before the bot starts. e.g. You could overwrite profile settings here
-- like: changeProfileOption("HP_REST", 60);
]]></onLoad>
Re: useGoodie
at the top of functions.lua it says something like this
just add the include at the top
or if you want to leave functions.lua as it is by default then in all of your profiles
you just had a < in the code you posted that shouldn't have been there
Code: Select all
if( settings == nil ) then
include("settings.lua");
end
Code: Select all
include("userfunctions.lua");
if( settings == nil ) then
include("settings.lua");
end
Code: Select all
<onLoad><![CDATA[
include("userfunctions.lua");
]]></onLoad>
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
You don't need to do any of that. Revision 472 already has code to use "userfunctions.lua". You'll see near the top of bot.lua
Edit: I thought you had 472. I see above you said you had 468. What I said still applies
Code: Select all
if( fileExists(getExecutionPath().."/userfunctions.lua") ) then
include("userfunctions.lua");
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
worked fine
but the luck potion is named differently in my server, it is:
lucky target
but the luck potion is named differently in my server, it is:
lucky target
Re: useGoodie
Those names that are used by useGoodie is not buff names. They are just words that i have defined and i could change that name to what i want. For example using usegoodie("luck") it would search client specific buff name by using buff ids that are defined in code.
Re: useGoodie
the good thing i am not getting errors any more, I have version 475
the way i have done is as u said, cereated a file called userfunctions.lua
copy and paste both catch cavi and useGoodies into that file
than added one line into my profile like this after onLoad:
include "userfunctions"
as described above by rock5
now, how should i call the buff "luck" or the action "catch_cavi()" into action after <onLeaveCombat>?
the way i have done is as u said, cereated a file called userfunctions.lua
copy and paste both catch cavi and useGoodies into that file
than added one line into my profile like this after onLoad:
include "userfunctions"
as described above by rock5
now, how should i call the buff "luck" or the action "catch_cavi()" into action after <onLeaveCombat>?
Re: useGoodie
I never said you needed to "include" userfunctions. I said 475 already includes it so you don't have to include it. All you have to do is create the "userfunctions.lua" file.
To use the functions add the following to the onLeaveCombat section,or
To use the functions add the following to the onLeaveCombat section,
Code: Select all
catchCavy() -- Will catch only Golden Magic Cavy and should work in any language.
Code: Select all
catchCavy("Cavy") -- Will catch both normal and golden, Change "Cavy" to your language.
- This is assuming you already made that change to the catchCavy function I talked about.
- Also you might need to upgrade to 477 to use catchCavy.
Code: Select all
useGoodie("luck")
- 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 2 guests