useGoodie

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.
Message
Author
User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

useGoodie

#1 Post by Giram » Sun Apr 24, 2011 1:36 pm

Description
This userfunction was created to use housemaids potions and foods. It first checks if we have that potion / food on inventory and after that it will check if we have buff on and if buff is on then it won't use that item. Otherwise it will use item.

My original userfunction was combined with Jduartedj and now this should be able to use any consumable. I will continue to support this project for now. This one should support clients with other languages than English. Buff names was changed to buff id's.

Just for reference i will link these links to those two threads where can be found info regarding to this one.
UseFood + useHousemaidPotions = useGoodie !!!
housemaid potions and foods

Troubleshooting:
- Default folder for userfunctions is micromacro\scripts\rom\userfunctions
- Delete or move previous versions of useGoodie userfunctions away from userfunctions folder
- If bot is using items everytime it uses function then the buff ID is wrong. Userfunction checks first if we have potions on inventory then it will check if we have buff from that item. If those are true then it will use item.

Available commands
To use housemaid items you need to write these as they are here. These can be placed for example in onLeaveCombat, onSkillCast, onPreSkillCast or in waypoint file.

Code: Select all

useGoodie("giant"); -- Fullness
useGoodie("speed"); -- Unbridled Enthusiasm
useGoodie("frog"); -- Princely Look
useGoodie("casting"); -- Clear Thought
useGoodie("luck"); --Turn of Luck Powder Dust
useGoodie("riding"); --Galloping Gale
useGoodie("jump"); --crazy breakout
useGoodie("defense"); --Scarlet Love
useGoodie("agro");  --Pungent Vileness
useGoodie("godspeed"); --Godspeed
useGoodie("pdmg"); -- Housekeeper Special Salted Fish with Sauce
useGoodie("mdmg"); -- Housekeeper Special Smoked Bacon with Herbs
useGoodie("critp"); -- Housekeeper Special Caviar Sandwich
useGoodie("matt"); -- Housekeeper Special Deluxe Seafood
useGoodie("patt2"); -- Housekeeper Special Spicy Meatsauce Burrito
useGoodie("mdmg2"); -- Housekeeper Special Delicious Swamp Mix
useGoodie("patt3"); -- Housekeeper Special Unimaginable Salad
useGoodie("matt3"); -- Housekeeper Special Cheese Fishcake
I am not very familiar with these ones but this is working also. Jduartedj did this part.

Code: Select all

useGoodie("item"); --if the item has the same buffname as the itemname
useGoodie("item","buff"); --only if you have an item with a buff diferent from its own name.
useGoodie(120556); -- Can cast by consumable ID.
useGoodie("Infinite Herb") --Uses Infinite herb.
useGoodie("Infinite Herb", "Infinite Herb") --This also gives buff so this works also

Examples

Code: Select all

<onLeaveCombat>
	useGoodie("speed");
	useGoodie("luck");
	useGoodie("patt3");
</onLeaveCombat>
useGoodie is usable in waypoint file too:

Code: Select all

<!-- #  1 --><waypoint x="3431" z="2695" y="47">
   useGoodie("defense");
   useGoodie("patt3");
</waypoint>
Link to modified useGoodie by Rock5
http://www.solarstrike.net/phpBB3/viewt ... 952#p21952
Attachments
userfunction_useGoodie_universal.lua
Version 5
(3.37 KiB) Downloaded 712 times
Last edited by Giram on Thu Jun 09, 2011 11:45 pm, edited 16 times in total.

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

Re: useGoodie

#2 Post by rock5 » Sun Apr 24, 2011 8:47 pm

You might want to add a bit of a description of what exactly the function does for newbys who don't know what this function does and how it works.
  • 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

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: useGoodie

#3 Post by M4gm4 » Mon Apr 25, 2011 6:27 am

hmm,, is there a check function ?
example

Code: Select all

if buff exist (do nothing)
else useGoodie("giant");
I use the google translator, so do not be surprised if my english is funny

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

Re: useGoodie

#4 Post by rock5 » Mon Apr 25, 2011 6:48 am

M4gm4 wrote:hmm,, is there a check function ?
example

Code: Select all

if buff exist (do nothing)
else useGoodie("giant");
LOL. That's why I said there needed to be a better description. useGoodie only uses the item if the buff isn't already on.
  • 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

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: useGoodie

#5 Post by M4gm4 » Thu Apr 28, 2011 2:21 pm

if there is no goodi ,wich is listet in your profile, in your bag, the bot gets an error an stops.?!
I use the google translator, so do not be surprised if my english is funny

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

Re: useGoodie

#6 Post by Giram » Thu Apr 28, 2011 4:10 pm

M4gm4 wrote:if there is no goodi ,wich is listet in your profile, in your bag, the bot gets an error an stops.?!
I don't totally understand what you mean by this. I have run with and without potions / foods that i get from housemaids and are listed on my profile and haven't got any errors lately. There was error sometime ago with getting buffs but i think it is now fixed. I thought it was because of my userfunction.

If you are using some other item could you tell me what you are using that causes bot to crash and you could also post error that you get. I could then try replicate that error and try to fix it.

There is check if we got item on inventory. If you don't have item on inventory it shouldn't do nothing. Error could be caused my missing update from somewhere or lack of rest between commands.

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: useGoodie

#7 Post by M4gm4 » Thu Apr 28, 2011 10:22 pm

i use

Code: Select all

	<onLeaveCombat>
		   useGoodie("speed");
		   useGoodie("luck");
		   useGoodie("matt2");
	</onLeaveCombat>
and the error msg is (sry, in german)
....../rom/classes/player.lua:1254: fehler im Profile bei der Zeitpunktverarbeitung: onLeaveCombat error
....../rom/classes/pawn.lua:537: bad argument #1 `gmatch´ (string expected, got nil)

than bot stops after the first fight
I use the google translator, so do not be surprised if my english is funny

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: useGoodie

#8 Post by M4gm4 » Fri Apr 29, 2011 2:06 pm

ok, now i have more information about the error..
when i have this error ,, and log out ,, the prompt with crit error comes
so its the situation, when the game used many loading screens oder travels from city to city or with transport runes.
the client crashed without log out ,, msg comes only at manual logout.
a restart of the client helps, and all works normal.

(hope you understand my bad english)
I use the google translator, so do not be surprised if my english is funny

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

Re: useGoodie

#9 Post by Giram » Fri Apr 29, 2011 4:02 pm

I am going through all housemaid items and found that few items will crash bot for some reason. I need to continue investigating this other time.

speed, luck, pat3, mat3 is working atleast.
M4gm4 wrote:i use

Code: Select all

	<onLeaveCombat>
		   useGoodie("speed");
		   useGoodie("luck");
		   useGoodie("matt2");
	</onLeaveCombat>
and the error msg is (sry, in german)
....../rom/classes/player.lua:1254: fehler im Profile bei der Zeitpunktverarbeitung: onLeaveCombat error
....../rom/classes/pawn.lua:537: bad argument #1 `gmatch´ (string expected, got nil)

than bot stops after the first fight
If you remove useGoodie("matt2"); i think it would work then so thats one bugging also.

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

Re: useGoodie

#10 Post by Giram » Tue May 03, 2011 10:56 am

Error "./rom/classes/pawn.lua:537: bad argument #1 `gmatch´ (string expected, got nil)" was caused by wrong buff IDs. I went through all ID' with rombot console and didn't get any errors when searched with ID. And changed those that gave error.

New stuff:
- aggro renamed to agro.
- jump has 3 sec cooldown
- riding has effect so i gave 1 sec for it
- Changed few IDs


I was able to test these and will test others if i have change to get those:

Code: Select all

useGoodie("giant"); -- Fullness
useGoodie("speed"); -- Unbridled Enthusiasm
useGoodie("frog"); -- Princely Look
useGoodie("casting"); -- Clear Thought
useGoodie("luck"); --Turn of Luck Powder Dust
useGoodie("riding"); --Galloping Gale
useGoodie("jump"); --crazy breakout
useGoodie("defense"); -- scarlet love
useGoodie("matt2"); -- Housekeeper Special Spicy Meatsauce Burrito
useGoodie("mdmg2"); -- Housekeeper Special Delicious Swamp Mix
Edit: Forgot to tell that i uploaded new version to first post yesterday.

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

Re: useGoodie

#11 Post by Giram » Thu May 12, 2011 10:15 am

Updated userfunction. Should work better now.

- matt2 renamed to patt2.
- Checked all potions. Those are working for me.
- Tested foods:
Housekeeper Special Salted Fish with Sauce
Housekeeper Special Smoked Bacon with Herbs
Housekeeper Special Spicy Meatsauce Burrito
Housekeeper Special Delicious Swamp Mix

Still needs to be tested:
Housekeeper Special Caviar Sandwich
Housekeeper Special Deluxe Seafood
Housekeeper Special Unimaginable Salad (checked)
Housekeeper Special Cheese Fishcake

Using other items are not working for some reason. Tried to check it but couldn't figure out what is wrong with that part.

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

Re: useGoodie

#12 Post by rock5 » Thu May 12, 2011 10:33 am

I think the problem is "option" needs to be declared a table before adding values to it (ID, buffName, castime). Try adding "option = {}".

Code: Select all

	if not option then
		option = {}
		if not _buffName then
			option.buffName = _itemName --Assume  both have same name like in mounts
		else
			option.buffName = _buffName
		end
		option.ID = _itemName --luckily the inventory functions use Name Or ID
		option.castTime = 0
	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
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: useGoodie

#13 Post by Giram » Thu May 12, 2011 10:42 am

That fixed that problem.

Tested:
useGoodie("Infinite Herb")
useGoodie("Infinite Herb", "Infinite Herb")

Thanks rock5 :)

edit: Uploaded fixed version.

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

Re: useGoodie

#14 Post by rock5 » Wed May 18, 2011 7:46 am

I noticed that if I move a food into my transmutor it doesn't get used. Can I suggest the following change that will allow it to work.

Change line 64;

Code: Select all

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

Code: Select all

	if inventory:itemTotalCount(option.ID,"all") >= 1 and not player:hasBuff(option.buffName) then
itemTotalCount defaults to counting only in the "bags". "all" will allow it to search the transmutor as well when counting the food or potion items.
  • 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: useGoodie

#15 Post by Giram » Wed May 18, 2011 12:08 pm

I will gladly take suggestions to improve my works. I will upload new version later. I think ids are wrong again :( . Starting to get frustrated about that problem. Well i am checking those again. ATM i still need 5 more test but probably can't test foods so i will get those from itempreview after it's finished importing. Lost all again after crash :(

I did test this:

Code: Select all

if inventory:itemTotalCount(option.ID,"all") >= 1 and not player:hasBuff(option.buffName) then
and it used items from AT also so that will come too in next update.

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

Re: useGoodie

#16 Post by Giram » Fri May 27, 2011 10:29 am

Uploaded new version.

- Removed GetIdName from table cause player:hasBuff() works with ids.
- Now it will search items from Arcane Transmutor and backback. Maybe could use item shop backback too but haven't tested that one.
- Checked few ids once again. I haven't been able to test all foods from housemaid. Only got chance to test 2 first and 2 last ones. But haven't seen any reports from those so can't say if those are not working. Multiple ID gives same name so it might still work even if it's not right one.

harbifm
Posts: 135
Joined: Wed May 25, 2011 11:43 pm

Re: useGoodie

#17 Post by harbifm » Sat May 28, 2011 2:03 pm

can you explian how to use it, I an a newbee

ok, I post into the script file, the copy
<onLeaveCombat>
useGoodie("speed");
useGoodie("luck");
useGoodie("matt2");
</onLeaveCombat>

into my profile afte this scetion:
<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy

so it become like this:

]]></onLoad>

<onDeath><![CDATA[
-- Additional Lua code to execute on death
-- pauseOnDeath(); -- Stop the script
-- player:logout(); -- logout
]]></onDeath>

<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy
]]></onLeaveCombat>
<onLeaveCombat>
useGoodie("speed");
useGoodie("luck");
useGoodie("matt2");
</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>


is this how it could be used?

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

Re: useGoodie

#18 Post by Giram » Sat May 28, 2011 2:24 pm

You have 2 instances of onLeaveCombat now and i don't know if it will work that way. But if you remove the first one. So this:

Code: Select all

<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy
]]></onLeaveCombat>
<onLeaveCombat>
useGoodie("speed");
useGoodie("luck");
useGoodie("matt2");
</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>
to this and it should work:

Code: Select all

<onLeaveCombat>
useGoodie("speed");
useGoodie("luck");
useGoodie("matt2");
</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>
You can also insert those useGoodie(""); commands to elsewhere. Like in waypoint file. This one will use those just before boss:

Code: Select all

<!-- #  1 --><waypoint x="3431" z="2695" y="47">
	useGoodie("defense");
	useGoodie("patt3");
</waypoint>
And between onPreSkillCast so it will use items before skills or onSkillCast so it will use item after using skills. But i prefer onLeaveCombat. You need to use those predefined words from first post to use housemaid items, item id or item name. You can get item ID these from itempreview addon or from site that list items like this one http://www.runesdatabase.com/ . Just search item you want to use for example http://www.runesdatabase.com/item/20009 ... r-sandwich . ID is on link after item word. So that can be used like this: useGoodie(200098); .

harbifm
Posts: 135
Joined: Wed May 25, 2011 11:43 pm

Re: useGoodie

#19 Post by harbifm » Sun May 29, 2011 12:02 am

did not work


where should I save the file (userfunction_useGoodie_universal .lua)?

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?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: useGoodie

#20 Post by lisa » Sun May 29, 2011 12:19 am

don't change the file names or any of the code that you have been told to use. place the file in your rom/userfunctions folder.

It's a good idea to also delete previous versions of a function if they are still in the folder.

Something to keep in mind is pretty much all content is designed for the current version of rombot, MM and runes of magic client. Since you are running with a client version that is over a year old a lot of the content won't work for you.
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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests