Page 1 of 3

planting like the flintstones

Posted: Mon Jul 04, 2011 12:29 pm
by lisa
Ok had lots of issues with this but here is a working copy with some very specific needs. I'm a little tired so hopefully this all makes sence lol

1. the game NEEDS to be the window in focus, it won't work in the background
2. place your pots in a patern like this image near your door, position character at doorway, the same you would be if you just entered house.
For 10 pots just do another row of 5 so you end up with
OOOOO
OOOOO
pot arrangement
pot arrangement
3. userfunction file needs to go intot he userfunctions folder lol
userfunction_PlantCare.lua
V 2.1
Camera works 100% for me now
(6.02 KiB) Downloaded 550 times
userfunction_PlantCare.lua
V 1.4
Latest and greatest, deals with newbie pet properly and watering after planting new seed refixed. I broke it in v1.3
(5.77 KiB) Downloaded 419 times
4. seeds.xml is a database file and needs to be in rom/database folder
seeds.xml
seeds database
thanks to blackpanzer for the update
(2.87 KiB) Downloaded 386 times
5. last but not least is of course the very basic WP file.
plantcare.xml
(255 Bytes) Downloaded 600 times
6. Make sure you have the autologin addon so it can load next character on account.
7. get the addon, ummm "plantcare" just D/L from curse here
Put everything where it's meant to go, put your pots in the right spot, fill your characters with water, fertilizer and seeds for your pots.

Start bot using the WP
ie
rom/bot path:plantcare

and away she goes.

Note:
It works more reliably if you zoom your camera in to first person view.

Reason I did the pots near door is so that I can use another waypoint to go outside and buy matts, then just come back and enter house. If you set up pots elsewhere then you will need to move closer to the pots. I deliberately made it not move to pots as that messes with where the pot is on the screen.

Re: planting like the flintstones

Posted: Mon Jul 04, 2011 11:50 pm
by lisa
Did some tweaking of the userfunction, added in checks to make sure the mouse is able to click the item.

If you are having trouble with it not clicking pots, then try to rotate the pot, rotating the pot will move the invisible box around.

I attempted to try to tweak the mouse to make it always get the pot but in the end it was more trouble then it was worth.

This does an account with 5 pots each char in less then 15 minutes, depending on the PC speed logging in and out of characters.

I set longcare in the properties of the addon, it just waters/fertilizers to the maximum instead of the recomended, this way I can just run the bot every 12 hours.

ohh yeah, newbie pets are evil, you can't click through them,
I'll have to add in a check for the pet and then use the egg to get rid of it.

Re: planting like the flintstones

Posted: Tue Jul 05, 2011 12:59 am
by rock5
lisa wrote:ohh yeah, newbie pets are evil, you can't click through them,
I'll have to add in a check for the pet and then use the egg to get rid of it.
Is it possible to do a shift-click?

Re: planting like the flintstones

Posted: Tue Jul 05, 2011 1:21 am
by lisa
Unfortunately I assumed shift click would go through newbie pet and based the code on that. It seems the newbie pet is considered to be like a portal or such and so holding shift doesn't ignore the newb.

I fixed it now in 1.3 anyway, just about to upload it, also made clicking the pot far more reliable.

This gets rid of the newb, for future reference =)

Code: Select all

	local pet = player:findNearestNameOrId(113199)
	if pet then inventory:useItem(207051); end -- get rid of the annoying newbie pet

Re: planting like the flintstones

Posted: Tue Jul 05, 2011 7:14 am
by nerf
downloading !

Re: planting like the flintstones

Posted: Tue Jul 05, 2011 11:47 am
by lisa
With V1.3 just did full account of 5 pots each character in 12 minutes with no hickups.

I did notice the newbie pet is arriving later on occasion, fortunately it didn't get in the way today. I'll have to add in the newbie pet check a bit later, or maybe include it in the loop so it is checked often.
That is pretty much the only issue I can think of to interfere with this, aslong as the pots are in a good position and char has plenty of water/fertilizer/seeds then it should run smoothly.

Anyone had an issues yet?

Re: planting like the flintstones

Posted: Thu Jul 07, 2011 11:13 am
by lisa
V1.4 of userfunction file

deals with newbie pet properly
watering after planting new seed refixed. I broke it in v1.3

I am going to leave this to rest here, I have been running an account with 5 pots on each char twice a day for a few days now and not had any issues at all.

Just make sure you have plenty of water, fertilizer and a hand full of seeds in bag.

I keep 20 seeds (same type) and 2 stacks (250 per stack) of water/fertilizer in bags, then few days later top up water/fertilizer.

Re: planting like the flintstones

Posted: Thu Jul 07, 2011 8:51 pm
by rock5
Time to add it to the repository?

Re: planting like the flintstones

Posted: Thu Jul 07, 2011 9:21 pm
by zin40
I do not want to sound negative, but planting is not as usefull as petautocraft. You can get mats higher than the weeping coast mats. The only thing usefull is mats for new moas. I have lvl 60 planters i have not used in 2-3 months because there is no real profit. I did look into this and it seems that it would work ok. When i planted the same seeds manually before this I noticed that I could water and feed only 2-3 times a day and get same result as keeping it full. As long as your % is 86 or higher when harvesting you will get max harvest.

Re: planting like the flintstones

Posted: Thu Jul 07, 2011 10:25 pm
by lisa
rock5 wrote:Time to add it to the repository?
I keep forgeting that part lol
Done =)
zin40 wrote:I do not want to sound negative, but planting is not as usefull as petautocraft.
Yeah pet crafting for matts is good profit at high lvles, most of my pets are lvl 35+ in a crafting.

I actually have no idea of the usefullness of planting, someone posted asking for a way to bot the plants and so I took up the challenge lol

For comparison purposes though,
pet crafting you need to be online the entire time you want to craft things.
Planting you just need to log on 2-3 times out of 24 hours and takes 1-2 minutes per character.

Re: planting like the flintstones

Posted: Fri Jul 08, 2011 8:41 am
by nokirk
don't know why yet but the bot just logs out right away without doing anything :?: Got water, got everything, file is in the userfunctions folder. Are there any language specific things I might need to change? Apart from that, tyvm!

Re: planting like the flintstones

Posted: Fri Jul 08, 2011 10:33 am
by lisa
Hmm might need to add in a yrest to the waypoint before starting the function, to make sure you loaded in properly.

As for language aslong as the pot has a name with the word " pot" in it then it should be fine. Seeds are all done with ID's.

I decided not to get all the Id's for pots as it would have taken me to long to get them all. there was over a hundred of them.

If your pots don't have the word " pot" in the name then we can change that in the userfunction easy enough.
line 64 has this

Code: Select all

_pot = normaliseString(" pot")

It searches the names of all the items in the house, including maids and such for the name " pot" you can change that to reflect your language.

Re: planting like the flintstones

Posted: Fri Jul 08, 2011 12:02 pm
by nokirk
you were right :)

Planting is working for us with

Code: Select all

_pot = normaliseString("topf")
(without space).

BUT: Don't know why, but

Code: Select all

		yrest(1000)
		RoMScript("HideUIPanel(PlantFrame);")
		yrest(500)
		printf("click it again to feed\n")
		mouseLClick(); 
		yrest(500) 
		mouseLClick();
opening the plant the second time doesn't work for me. I added another

Code: Select all

yrest(500) 
		mouseLClick();
but that didn't help, seems like the click kinda doesn't hit even though the mouse is above the right pot ?!

Re: planting like the flintstones

Posted: Fri Jul 08, 2011 12:34 pm
by lisa
in V1.2 and V1.4 it has detach() just before the click. For some reason when I recoded V1.3 to fix other things I left out the detach().

Try V1.4 and should be fine.

Re: planting like the flintstones

Posted: Thu Jul 21, 2011 1:38 am
by dx876234
Nice initiative, suddenly I found interest for planting.

I have modified the userfunction slightly by:
  • Added a material database with water/fertilizer
  • Modified the load of seed/material database to be globalized, I needed access in waypoint file and no point in loading multiple times
In addition Ive started on a waypoint for planting with the option to be valid in all zones:
  • Based on the original waypoint
  • Will exit house and walk to NPC to purchase seeds/water/fertilizer
  • Externalized the walk waypoint so its easy to add this for any zone
Outstanding list:
  • Selection of seed to purchase needs work to select optimum
  • Option to produce on one particular level has to be added
  • Option to mail production somewhere when backpack full
userfunction_PlantCare.lua
(6.11 KiB) Downloaded 398 times
plant_materials.xml
(826 Bytes) Downloaded 383 times
gardener.zip
(5.15 KiB) Downloaded 387 times

Re: planting like the flintstones

Posted: Thu Jul 21, 2011 3:33 am
by lisa
Cool glad you found it useful

I actually don't plant anymore, purely did it as a challenge ;)

Re: planting like the flintstones

Posted: Fri Dec 09, 2011 6:35 am
by Daehawk
Is anyone still using this and it works ? I cannot get it to run, keep getting

9:28pm - scripts\rom/bot.lua:464: onLoad error: ...scripts/rom/userfunctions/use
rfunction_PlantCare.lua:64: attempt to call global 'normaliseString' (a nil value)


Dont understand what is wrong, i have the pots set out correctly and the scripts in place

Re: planting like the flintstones

Posted: Fri Dec 09, 2011 7:05 am
by lisa
Ahh that is calling a function which is actually in the questbyname userfunction.

If you want you can add it in to this userfunction

Code: Select all

local function normaliseString(_str)
	_str = string.gsub(_str, string.char(45), ".")	-- Delete "-" in string
	_str = string.lower(_str) -- Lower case
	
	return _str
end
after

Code: Select all

local function roundIt(_number)
	if _number > (math.floor(_number) + 0.5) then
		return math.ceil(_number);
	else
		return math.floor(_number);
	end
end
would be a good spot.
So it looks something like this.

Code: Select all

furniture = {}
local function roundIt(_number)
	if _number > (math.floor(_number) + 0.5) then
		return math.ceil(_number);
	else
		return math.floor(_number);
	end
end
local function normaliseString(_str)
	_str = string.gsub(_str, string.char(45), ".")	-- Delete "-" in string
	_str = string.lower(_str) -- Lower case
	
	return _str
end
		
--=== populate seeds to a table ===--

Re: planting like the flintstones

Posted: Fri Dec 09, 2011 10:13 am
by lisa
Just tried this again, haven't used it since I made it.
Since the camera has been changed in bot a while back this won't work anymore as need to now reconfigure the camera to be facing the right spot. Took me many hours to get it right last time lol

Updated first post with V2.0 with camera values that work for me.

Re: planting like the flintstones

Posted: Fri Dec 09, 2011 11:18 pm
by lisa
V 2.1 camera works properly now, much more reliable.