Jump to content

Trying to exclude one fishing spot


yibster2009

Recommended Posts

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.

Link to comment
Share on other sites

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 by liverare
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...