Jump 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.

error when trying to interact with fishing object

Featured Replies

attempt to interact in the following way:

RS2Object fish_pot = getObjects().closest("Fishing spot");
fish_pot.interact("Small Net");

and I get the following error:

[ERROR][Bot #1][05/09 02:23:35 PM]: Error in script executor!
java.lang.NullPointerException
    at Scripts.Bot.onLoop(Bot.java:479)
    at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ph:114)
    at java.lang.Thread.run(Unknown Source)

 

getObjects().getClosest() can return a null object, I'd recommend trying some Java tutorials to learn about NPEs.

Hey man, try this:

if(fish_spot != null){

fish_spot.interact("Small Net");

}

Btw: I think fish spots are npcs instead of rs2objects , but i'm not sure

Edited by Hannes7337

5 hours ago, trainux said:

oh! interesting are NPC. Thank you all.

Yes, and make sure you do your null check.

final NPC fishingSpot = script.getNpcs().closest("Fishing spot");

if (fishingSpot != null) fishingSpot.interact("Small net");

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.