Nah, very fast system and not using radar while harvesting in general. I only have problems with it zig-zagging because it misses waypoints that I have set close together. For example, if they're spaced at a distance of about 5-10 clicks away from each other. I do this in areas that are otherwise impossible to navigate automatically (some areas of Feerrott, Rivervale, etc.).
Although I did rewrite the entire FindResource function to improve speed. Instead of updating the list of available resources for each node type you're searching for, I have it just do it once for the whole set of searches at each stop. I also eliminated the calls to FindNextNearestMob since they were logically unnecessary (if we found one closer, why would we ever go to one further away?) and actually fixed a bug in the process that was eliminating valid nodes 'close by' if they were behind you. The function could be made even more efficient if we wanted a raw list of all of the nodes and cycled through them, examining each node name versus our list of nodes we're interested in (single-pass) and reducing the number of distance calculations by half in the process, but I have only been making minor modifications in general and not looking to see if something like this is even possible yet.
Here is my version of FindResource:
Code: Register to unlock hidden link
Function FindResource()
Dim index, mobname, distance, mobx, moby, foundid
Dim rx, ry, TmpSpawnID
Dim nodefinder
Dim lastdistance, thisdistance
FindResource = False
spawnid = -1
nodefinder = -1
lastdistance = 99999
thisdistance = 99999
If MaxWander > 5 Then
oDebug.PrintStatus "Looking for resources (updating node data)...", 1
oSvcObj.UpdateData
For index = 0 to 9
if resources(index,2) Then
oDebug.PrintStatus "Looking for '" & resources(index,1) & "'...", 1
tmpspawnid = oSvcObj.FindNearestMob(resources(index,1))
If NodeIsValid(TmpSpawnID) Then
rx = oSvcObj.mobx(TmpSpawnID)
ry = oSvcObj.moby(TmpSpawnID)
thisdistance = Abs(DistanceTo(rx, ry))
oDebug.PrintStatus "Looking for '" & resources(index,1) & "'... found! Distance is " & round(thisdistance, 1) & ".", 5
If WithinRange(rx,ry,WayPointX,WayPointY,MaxWander) or WithinRange(rx,ry,currx,curry,15) Then
oDebug.PrintStatus "(within range, distance is " & round(thisdistance, 1) & " versus max of " & MaxWander & ")", 5
thisdistance = Abs(DistanceTo(rx, ry))
if ClosestFirst then
If (nodefinder < 0) or (thisdistance < lastdistance) Then
nodefinder = TmpSpawnID
lastdistance = Abs(DistanceTo(rx, ry))
distance = lastdistance
resourceindex = index
MobName = getmobname(oSvcObj, nodefinder)
MobX = oSvcObj.mobx(nodefinder)
MobY = oSvcObj.moby(nodefinder)
End If
Else
nodefinder = TmpSpawnID
distance = lastdistance
resourceindex = index
MobName = getmobname(oSvcObj, nodefinder)
MobX = oSvcObj.mobx(nodefinder)
MobY = oSvcObj.moby(nodefinder)
Exit For
End If
Else
oDebug.PrintStatus "(out of range, distance is " & round(thisdistance, 1) & " versus max of " & MaxWander & ")", 5
End If
End If
End If
Next
If nodefinder > -1 then
MoveToX = MobX
MoveToY = MobY
SpawnID = nodefinder
FindResource = True
oDebug.Print "Moving to " & resources(ResourceIndex,1), 1
Else
oDebug.Print "Resources gone, moving on...", 1
if EraseBadSpawns then
BadSpawnCount = 0
end If
HarvestedNodeCount = 0
end if
End If
End Function