Has anyone else picked up on this? player:findNearesrNameOrId is limited to the "HARVEST_DISTANCE" range.
This to me seems wrong. findNearestNameOrId should find the nearest regardless of distance and then the function calling it should decide if it's close enough or not.
Do you agree?
player:findNearestNameOrId limited to HARVEST_DISTANCE?
player:findNearestNameOrId limited to HARVEST_DISTANCE?
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
Lol you are right, I had to look over the code twice just to make sure.
It is deffinately using harvest distance as the distance for the function findNearestNameOrId()
The distance should be set by what is calling the function, so prob need to add in another arg to the function and change everything that calls the function to include a distance.
Or if the new arg doesn't exist then use the harvest dist as a default distance.
It is deffinately using harvest distance as the distance for the function findNearestNameOrId()
The distance should be set by what is calling the function, so prob need to add in another arg to the function and change everything that calls the function to include a distance.
Or if the new arg doesn't exist then use the harvest dist as a default distance.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
I was thinking more along the lines of having findNearestNameOrId just finding the nearest and moving the final distance check to the functions that is calling it, eg. player:target_Object and player:target_NPC. eg.
Your idea has merit too, though. It would avoid repitition of code to check the final disatance.
Code: Select all
local npc = self:findNearestNameOrId(_npcname)
if npc and ( distance(self.X, self.Z, self.Y, npc.X, npc.Z, npc.Y ) < settings.profile.options.HARVEST_DISTANCE )then -- we successfully found NPC- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
On second thought, findNearestNameOrId already has 3 arguments
Might be a bit excessive adding another one. I think I'll just do it my way. After all, only target_NPC and taregt_Object use findNearestNameOrId.
Your party functions will probably benefit. I'm guessing you don't want searching for party members limited to harvest range.
Code: Select all
CPlayer:findNearestNameOrId(_objtable, ignore, evalFunc)Your party functions will probably benefit. I'm guessing you don't want searching for party members limited to harvest range.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
a file search of one of my rom folders got 27 occurances of findNearestNameOrId,
13 in WP
7 in classes, not including the function findNearestNameOrId
1 in functions.lua
6 in userfunctions
Most people will probably only have 8-10 though.
For party bot it only uses it when healer is started up and creates the table of party members.
13 in WP
7 in classes, not including the function findNearestNameOrId
1 in functions.lua
6 in userfunctions
Most people will probably only have 8-10 though.
For party bot it only uses it when healer is started up and creates the table of party members.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
In classes I only see 5 not including player:findNearestNameOrId(). 2 in party.lua and 3 in player.lua (target_NPC and Target_Object like I said). Where are you seeing the other 2?lisa wrote:a file search of one of my rom folders got 27 occurances of findNearestNameOrId,
13 in WP
7 in classes, not including the function findNearestNameOrId
1 in functions.lua
6 in userfunctions
Most people will probably only have 8-10 though.
For party bot it only uses it when healer is started up and creates the table of party members.
The 1 in functions has to do with party members.
Of the userfunctions and waypoint files, do you think any of them will suffer from having no limit on the distance?
Of the few I have, I think only catchCavy will suffer. It needs a limit on the distance it should go to catch a cavy.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: player:findNearestNameOrId limited to HARVEST_DISTANCE?
I tend to only use the findnearest function when I am close to where it should be anyway, so only way a larger range would mess it up is if it doesn't use the nearest. Since it should be coded to use nearest then I don't see an issue for my situations. Having said that I would stick to within 200 yards.rock5 wrote:Of the userfunctions and waypoint files, do you think any of them will suffer from having no limit on the distance?
Yes I deff agree there should be a limit on distance, as it will see cavy's from other people killing and may run off a cliff to get to it. Catch Cavy should be within max target distance.rock5 wrote:Of the few I have, I think only catchCavy will suffer. It needs a limit on the distance it should go to catch a cavy.
Only time I run with default bot is when testing issues for people lolrock5 wrote:Where are you seeing the other 2?
That's why I have a few mm/bot folders. I am also working on a "light" version of the bot hoping it will use less resources for multiclient runs. Aiming it at healers and followers. So no fighting, just follow/loot and heal if set up to, otherwise do nothing but follow/loot. Hard to gauge how much effect it is going to have on PC resource usage. Not sure how to test that just yet.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual