Page 1 of 1
EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 11th, 2005, 5:53 pm
by sirusdv
Update: Fixed a bug in the harvesting loop
Things I have changed / added:
Waypoint system! There is an array similar to the Resources array where you can input the X and Y coordinates of points (use /loc to get the coordinates the first and thrid values are the X and Y). You can also set a bool (true/false) weather or not the waypoint is purely navigational or if you want to harvest resources at that point too (use this incase you need to get around a corner or something or just change direction)
Improved harvesting! Since the new patch there was an update where resources do not disapear after only 3 harvests. The script now takes that into account
http://www.xunleashed.com/dload.php?act ... ile_id=145
Re: EQ2Harvest v1.1.2 (WAYPOINTS!)
Posted: April 12th, 2005, 9:36 am
by simucal
Awesome job mate! Keep up the good work.
Re: EQ2Harvest v1.1.2 (WAYPOINTS!)
Posted: April 12th, 2005, 9:59 am
by alcor75
Code: Select all
TargetID = getTargetID(oServiceObject)
do while (TargetID = SpawnID)
HarvestResource
loop
Pls corract me but shoulen't it be:
Code: Select all
TargetID = getTargetID(oServiceObject)
do while (TargetID = SpawnID)
HarvestResource
getTargetID(oServiceObject)
loop
oterwise it will harvest forever the first resource it finde, since the target is not updated and it id is alwais the same even if the res. if not there anymore.
Btw this is a wanderfull script, tnx you wery much for sharing it with us.
Posted: April 12th, 2005, 11:17 am
by sirusdv
Good call on the bug, I am uploading a new version as we speak
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 12th, 2005, 12:26 pm
by envison
Installed new version. Resetup waypoints/Resources.
Once started it will find 1 resource and properly harvest off it. However past that 1 it wont find anouther. Ive updated service ect .
The more than 3 times is working correctly on the one node it harvests. So that problem seems to be fixed

Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 14th, 2005, 12:40 am
by thadious
Only problem I see is that if you get to an unharvestable node, it will get stuck. It will attmept to harvest, you get the "Too Far Away" message, it retargets and tries again. I modified the older version by putting a simple check in to see if you still have the node targeted after X attempts. Perhaps we could add something like this? Let me know if you have an easy fix.
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 14th, 2005, 4:07 pm
by sirusdv
I will add a simple fix by calling the move function again and checking distance to see if your position has changed much if it fails it will then do a small random move and retry if that fails then it will add node to bad node list.
I will add this as soon as this damn novicaine wears off....
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 15th, 2005, 11:23 pm
by drakinn
yaim having the same problem get stuck trying to harvest a bad node. any chance we can get this fixed asap, other then that its killer script.
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 17th, 2005, 7:09 pm
by llew22
Disclaimer: I've never done programming or scripting before, but it seems like common sense...
Here is what I did to deal with the "too far away" bad node problem:
added a SpawnHarvestCounter variable
Dim HarvestCounter, SpawnHarvestCounter, MaxHarvests, MaxWanderDistance
changed harvest subroutine to limit it to 12 attempts. This is probably overkill, but I wanted to be on the safe side.
Code: Select all
sub HarvestResource()
if (SpawnID > 0) then 'Make sure we still got a target
writeLogLine("Harvesting...")
XUScriptPlugin.staStatus.Text = "Harvesting. . .Only " & MaxHarvests - HarvestCounter & " more!!!"
SendKeys(Resources(ResourceIndex)(0))
HarvestCounter = HarvestCounter + 1 'One down!
SpawnHarvestCounter = SpawnHarvestCounter + 1
if (SpawnHarvestCounter = 12) then
HandleBadResource
FindResource
end if
sleep 5000 + Random(500,1500) 'Wait 5 seconds to harvest + a random delay of .5 to 1.5 seconds
end if
end sub
I've tested that it correctly shuns resources it tries 12 times to harvest, but it may have some logic errors that I'm not seeing right away (zeroing the counter, maybe?)
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 17th, 2005, 10:01 pm
by llew22
By the way, it seems like it would be fairly easy to automate the choosing of which resources to harvest. Just get the Zone name and use it to select which array of resource name data to use. It would take a little while to enter all the data, but it seems worthwhile to avoid having to change it all the time.
The next thing I would do after that, if I were a smarteyman, would be to "score" each resource based on distance and type. For example, the user would edit the VBS to assign a "desirability" rating to each resource. The script would then calculate priority for all resources in the area once it started up and after each node. The calculation would need to be refined with testing (and people would want to customize it). Something like:
priority = desirability /distance^2
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 18th, 2005, 1:10 am
by llew22
Well, my change doesn't seem to work for more than 1 bad node. I am still trying to figure out where I should reset the counter to 0 (I think it keeps counting up past 12, so it never hits the check).
Edit: Ok, that was a bad attempt. I decided it was bad to mess with the harvest function itself. Plus, I needed to initialize SpawnHarvestCounter.
I'm going to do the check for 12 attempts in the main area of the program, in the "do while..." loop at the end. I'll post the change if it works. In the meantime, don't use that other thing

Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 18th, 2005, 2:07 am
by llew22
Ok, I have one that has worked for me thus far...
I added the following variables:
Dim SpawnHarvestCounter, MaxSpawnHarvests
initialized them as follows:
SpawnHarvestCounter = 0
MaxSpawnHarvests = 12 (should be able to lower it to 8 or so with no ill effects)
Changed the Harvesting subroutine to look like this:
Code: Select all
sub HarvestResource()
if (SpawnID > 0) then 'Make sure we still got a target
writeLogLine("Harvesting...")
XUScriptPlugin.staStatus.Text = "Harvesting. . .Attempt " & SpawnHarvestCounter + 1 & " of " & MaxSpawnHarvests
SendKeys(Resources(ResourceIndex)(0))
HarvestCounter = HarvestCounter + 1 'One down!
SpawnHarvestCounter = SpawnHarvestCounter + 1
sleep 5000 + Random(500,1500) 'Wait 5 seconds to harvest + a random delay of .5 to 1.5 seconds
end if
end sub
and changed the end of the big "if" statement in the main script to look like this:
Code: Select all
do while (TargetID = SpawnID)
HarvestResource
TargetID = getTargetID(oServiceObject)
if (SpawnHarvestCounter = MaxSpawnHarvests) then
HandleBadResource
SpawnHarvestCounter = 0
TargetID = 0
end if
loop
SpawnHarvestCounter = 0
I'm not sure if that's the right way to clear out the targetId, but it seems to work.
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 19th, 2005, 3:15 pm
by simucal
Any chance you can add this to your script Sirusdv?
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 20th, 2005, 5:45 pm
by thadious
Not sure if anyone has followed my updates along the way so far but I added Sirus' kickazz mod to the find closest spawn mod. The only problem I have with it so far is that it will occasionally skip a node that you can see is good and go to the next waypoint. I mostly just chopped the codes together and will play with it tonight to find the problem. Feel free to dive in a see if you can find the problem, other than that, works like a champ.
Re: EQ2Harvest v1.1.3 (WAYPOINTS!) [UPDATED]
Posted: April 22nd, 2005, 6:16 am
by simucal
anyone else had any problems with this script after a little while of harvesting just running back and forth between waypoints saying there are no resources when there really are?