Page 1 of 1

Basic Harvesting *solved*

Posted: Mon Aug 02, 2010 2:41 pm
by Wundervice
Solved.

Re: Trading with the Bot

Posted: Mon Aug 02, 2010 10:13 pm
by rock5
I can't really help you because I've never done trading before but I have 2 observations.

1. You don't need to do inventory:update() because it is included in itemTotalCount.
2. I suspect you can let the count get to 15. The quest will become complete ad you wont be able to collect the item anymore. But once they are traded away the quest is no longer complete so you should be able to collect them again. I'm not sure, but it's something you can test.

Re: Basic Harvesting (revised)

Posted: Tue Aug 03, 2010 3:15 pm
by Wundervice
Just a bump. Im not sure how I would make the bot check for additional nodes at the same waypoint tho.

Re: Basic Harvesting (revised)

Posted: Tue Aug 03, 2010 11:06 pm
by rock5
Wundervice wrote:Okay so I decided to start with something more basic. Learning how to create a script to ID an item node (not resource) and harvest all at a single waypoint as a start to the learning process. Im thinking this is how it should be written:

<!-- #1 --><waypoint x="xxxx" z="xxxx">
player:target_Object(xxxxx,xxxx,true) <-- Not sure what the numbers are that go here tho. Item IDs, coordinates?
while player:target_Object(xxxxx,xxxx) do
sendMacro("UseSkill(1,1)") yrest(5500)
end

That would make the bot target the items nearby and harvest then with about a 5-second wait between attempts yes?
The reason you had to bump it is because editing a post doesn't bring it to the top of the list again, so no one knows you are expecting an answer.

The above is wrong. When you do "while player:target_Object(xxxxx,xxxx) do" it actually executes the function and uses the returned result. So target_Object gets executed at least twice.

Most of the time all you really need is

Code: Select all

player:target_Object()
with the appropriate options for the item you are harvesting.

This is how I decide what options to use for a new object.

Click it manually. Then;
1. If it's collected instantaneously then use

Code: Select all

target_Object(NameorId)
2. If it takes time to collect then add 2nd value.

Code: Select all

target_Object(NameorId,time)
3. If I want to collect multiple times then use the 3rd value.

Code: Select all

target_Object(NameorId,time,true)
4. If each item needs to be clicked more than once then use the 4th value.

Code: Select all

target_Object(NameorId,time,true,true)
5. Finally, if it is an unusual item that needs an action between clicks, eg. the eggs, then don't use the last 2 options but instead use the while loop.

Code: Select all

		while player:target_Object(NameorId,time) do
			...Do something between clicks
		end
I hope that makes it clear enough.

You can read about the target_Object function in the wiki.
http://www.solarstrike.net/wiki/index.p ... _Functions

*SOLVED*

Posted: Sat Aug 07, 2010 6:26 pm
by Wundervice
beep

Re: Basic Harvesting (revised)

Posted: Sat Aug 07, 2010 7:53 pm
by rock5
Wundervice wrote:Tests failed. Having trouble getting it to recognize harvestables.. tried the name of the item, the name of the node itself, and the item id.

<waypoints>
<!-- # 1 --><waypoint x="-1838" z="4846">
player:target_Object(206756,6000,true)
sendMacro("UseSkill(1,1)") yrest(6000)
</waypoint>

</waypoints>
That's the id of the item in your inventory, it's different to the id of the node you have to click. As I've said multiple times in numerous threads, use rom/getid.lua to get the id of the node.

As to why the node name failed, I can't really say unless I saw the command you used. Maybe you spelt it wrong?

Also, why do you click it twice? You're not accidently interupting the first click with the second, are you?