Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

closestNPC function not working properly

Featured Replies

Or maybe i was just the only one to expect that function to return the actual closes npc by specified name/id. 

 

Im trying to use closestAttackableNPCForName() and i notice that it doesnt get the closest, actualy it seems like it chooses randomly from the one in some middle range.

1) It's a method

2) You have to add an argument (id of what your getting or the name in this case)

Edited by Swizzbeat

When you are checking for the closest one, make sure you check immediatly before attacking. Like this, 

 

NPC whatever = closestAttackableNPCForName();

attack that npc on the next line.

 

Otherwise you have stored the npc as the closest one at the time that you checked for them. That could possibly pose an issue. If you check immediately before attacking, that should be good. 

 

 

Edit: Im assuming that you have a string name as the parameters right?

Edited by Mysteryy

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.