Page 1 of 1

Use of harvest

Posted: Mon Jul 30, 2012 12:51 pm
by vegasmike
I apologize if this was covered elsewhere but I was unable to find anything on this in any threads that seemed even slightly relevant. I am having a problem with player:harvest(). For some objects, it works; for others, it does not.

Here is a line from my WP file

Code: Select all

<!-- # 13 --><waypoint x="-26189" z="34159" y="-144">player:target_Object(118914);player:harvest(118914, nil, true, true);</waypoint>
When I walk to the waypoints, I get a confirmation of the item name in MM as being found and that it will be harvested. However, the item never harvests and the quest never updates.

Using the harvest command in other quests, specifically ones in which the object being used is a caged prisoner, works just fine as applied but does not here. Any help would be appreciated.

Re: Use of harvest

Posted: Mon Jul 30, 2012 1:52 pm
by rock5
player:harvest doesn't have that many options and should only really be used when collecting resources such as wood, herbs and ore. player:target_Object is for collecting objects. That's the function that has all the options for dealing with differerent types of objects.

Re: Use of harvest

Posted: Mon Jul 30, 2012 2:27 pm
by vegasmike
rock5 wrote:player:harvest doesn't have that many options and should only really be used when collecting resources such as wood, herbs and ore. player:target_Object is for collecting objects. That's the function that has all the options for dealing with differerent types of objects.
After having excluded the player:harvest() function, I still have the same issue. MM says it recognizes the item by name and will harvest but it does not harvest the quest items from the node. Here is what I did:

Code: Select all

	<!-- # 13 --><waypoint x="-26189" z="34159" y="-144">player:target_Object(118914, nil, true, true);</waypoint>

Re: Use of harvest

Posted: Tue Jul 31, 2012 12:50 am
by rock5
Is it posible it's the wrong id? There is a quest item in Xaviera that has 2 ids, one is for the object you see and one is for the object you click. People usually have trouble botting it because they try to click the wrong id. When you click the Wildbery, does it disappear or does it just become unclickable but still visible?

Re: Use of harvest

Posted: Tue Jul 31, 2012 10:23 am
by vegasmike
rock5 wrote:Is it posible it's the wrong id?
It is certainly possible. I am very new at this. I got the ID by using getid. Are there better ways to go about getting the numbers?
rock5 wrote:When you click the Wildbery, does it disappear or does it just become unclickable but still visible?
Once MM shows that the item has been found and will be harvested, if the command to player:target_object() is resent immediately, MM gives a message for no harvestables available. However, on this second command, the cog never disappears from the screen which makes it seem as if the node is still available for harvest. The Wildberry never actually disappears.

Re: Use of harvest

Posted: Tue Jul 31, 2012 1:31 pm
by rock5
Here is a little waypoint file I just wrote. Stand near a Wildberry and run it. It should print info on all objects within a radius of 50 from the player. If there is a second id printed with the same coords as the wildberry then that is probably the id you should be targeting.

Re: Use of harvest

Posted: Tue Jul 31, 2012 3:53 pm
by vegasmike
rock5 wrote:Here is a little waypoint file I just wrote. Stand near a Wildberry and run it. It should print info on all objects within a radius of 50 from the player. If there is a second id printed with the same coords as the wildberry then that is probably the id you should be targeting.
I ran the WP and it didn't bring up any other names.

Re: Use of harvest

Posted: Wed Aug 01, 2012 8:58 am
by rock5
vegasmike wrote:I ran the WP and it didn't bring up any other names.
So it didn't print anything at all in green?

Re: Use of harvest

Posted: Wed Aug 01, 2012 9:52 am
by vegasmike
rock5 wrote:
vegasmike wrote:I ran the WP and it didn't bring up any other names.
So it didn't print anything at all in green?
There are just the "Tergothen Wildberry"s from the area. The WP didn't yield any object IDs for me to compare but the names are the same as the quest as well as the tooltip.

Re: Use of harvest

Posted: Wed Aug 01, 2012 11:11 am
by rock5
Seeing as the item doesn't disappear, I was sure there was going to be more ids, either 2 objects with the same name but 2 ids or an unnamed object with a different id. I'm not sure what else to suggest.

Re: Use of harvest

Posted: Thu Apr 04, 2013 4:33 pm
by abron1
I was trying to use this code to get the id of the Mysterious bag in Merdhin Tundra but it didn't print any id's

Code: Select all

GM detection started
Dist: 27,       Name: Mysterious Bag,   X: 2200.00,     Z: -9395.00
Dist: 26,       Name: Sugon Highland Reindeer,  X: 2200.63,     Z: -9395.67
Dist: 20,       Name: Mrbigshot,        X: 2236.05,     Z: -9391.15
Did not find any crashed game clients.
2:27pm - [string "..."]:14: End of file.
because I crash when I get bags there but no other zone I was wondering if the ids where different

Re: Use of harvest

Posted: Thu Apr 04, 2013 7:45 pm
by lisa
if you want info of a nearby object you can have a userfunction like this.

Code: Select all

function kk(_arg1)
	local objectList = CObjectList();
	objectList:update();
	local objSize = objectList:size()
	for i = 0,objSize do
		obj = objectList:getObject(i);
		if string.find(obj.Name,_arg1) then
			table.print(obj)
		end
	end
end
then just start up commandline and use

Code: Select all

kk("Mysterious")
It is case sensative but you don't need the entire name.

Re: Use of harvest

Posted: Mon Jun 10, 2013 10:12 am
by skatje008
<onLeaveCombat><![CDATA[
if player:findNearestNameOrId("Mysterious Bag") then
player:target_Object("Mysterious Bag")
yrest(500) -- If not enough time to pick up bag, increase it.
player:target_Object("Mysterious Bag")
yrest(500)
end
catchCavy("cavy")
-- Additional Lua code to execute after killing an enemy
]]></onLeaveCombat>

worked fine by me, only problem i had that after a couple bag loots somtimes 10 sometimes 5, so random the game crashes...
it loots, it crashes,, very strange.

Re: Use of harvest

Posted: Mon Jun 10, 2013 12:03 pm
by McGuffin
skatje008 wrote: worked fine by me, only problem i had that after a couple bag loots somtimes 10 sometimes 5, so random the game crashes...
it loots, it crashes,, very strange.
Try using this in <onLeaveCombat>

Code: Select all

    if player:findNearestNameOrId("Mysterious Bag") then
        player:target_Object("Mysterious Bag")
        yrest(1000) -- If not enough time to pick up bag, increase it.
    end