August 10, 20178 yr I have a fishing script but one spot cant be accessed there is a npc sitting there. I want to be able to remove that one tile or spot so the bot doesn't find it and click on it forever. there are 4 spots in the area i want to use the other 3 only. How would i do this? im retarded when it comes to programming so please bare with me.
August 10, 20178 yr If the fishing spot you don't want the script to click on has static coords, you could use that. Edited August 10, 20178 yr by JARNQ
August 10, 20178 yr Author 11 minutes ago, JARNQ said: If the fishing spot you don't want the script to click on has static coords, you could use that. how can i check this?
August 10, 20178 yr 27 minutes ago, yibster2009 said: how can i check this? exclude the fishing spot if it is on that tile. Use filters.
August 11, 20178 yr It'd help if you could tell us where the fishing spot is but you could try using a filter to exclude it with getMap().canReach(). So when you're getting the fishing spots do: NPC fishingSpot = getNpcs().closest(x -> x.getId() == fishingSpotID && getMap().canReach(x)) Edited August 11, 20178 yr by d0zza
August 12, 20178 yr On 11/08/2017 at 4:26 AM, d0zza said: It'd help if you could tell us where the fishing spot is but you could try using a filter to exclude it with getMap().canReach(). So when you're getting the fishing spots do: NPC fishingSpot = getNpcs().closest(x -> x.getId() == fishingSpotID && getMap().canReach(x)) Filtering by IDs is bad unless you dynamically retrieve those IDs and store them on each run. Because otherwise, a RuneScape update will change those IDs breaking your script. Running #canReach each is bad practice. If there's only one position you need to filter for, store that position as a constant and check against it. Running path-finding algorithm to exclude one fishing spot would be unnecessarily process intensive. Alternatively, you could write up a small tile-flag checker around the north, east, south, and west tiles of the fishing spot to determine whether it's a tile that can your player can stand on. That wouldn't be as bad and would be more applicable. However, be sure to store the results so you, so you don't keep asking the same questions you already know the answer to. Edited August 12, 20178 yr by liverare
Create an account or sign in to comment