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.

Help with Fishing script

Featured Replies

Bot will walk to fishing area and i manually start fishing and get full invent it will bank but wont start fishing itself

Code to start Fishing

 private void StartFishing() throws InterruptedException {
        Entity FISH = objects.closest("Rod Fishing spot");

        if(FISHAREA.contains(myPlayer())){           
          if (FISH != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
               FISH.interact("Bait");
                new ConditionalSleep(Script.random(10000, 15000)) {
                    public boolean condition()
                            throws InterruptedException {
                        return !myPlayer().isAnimating();
                    }
                }.sleep();
            }
        }
    }

Fishing spots are actually NPCs, try that instead and see if its fixed

I actually made on today too! ^^ Take a look at my code and compare it to yours, see how alike they are. I left out the onstart and onpaint, those won't matter too much.

    @Override
    public int onLoop() throws InterruptedException {

        if (canFish()) {
            Fish();
        } else {
        	drop();
        }
        return 700;
    }

    public boolean canFish() {
        return (getInventory().contains("Fly fishing rod", "Feather") && (!getInventory().isFull()));
    }
    
   

    
    private void drop() throws InterruptedException {
        
    	if  (getInventory().isFull()) {
             getInventory().dropAllExcept("Fly fishing rod", "Feather");
            sleep(random(50, 105));
			new ConditionalSleep(5000, 600) {
			    @Override
			    public boolean condition() {
			        return (getInventory().isEmptyExcept("Fly fishing rod", "Feather"));
			    }
			}.sleep();
        } else {
            stop(false);
        }
    }
    

    
	public void Fish() throws InterruptedException	{
		
        NPC spot = getNpcs().closest("Rod fishing spot");

			if ((!myPlayer().isAnimating()) && spot != null)	{
				spot.interact("Lure");
				sleep(random(100, 200));
				getMouse().moveOutsideScreen();
				sleep(random(4000, 5000));
						}
						new ConditionalSleep(10000, 200) {
						    @Override
						    public boolean condition() {
						        return ((!myPlayer().isAnimating()) && (spot != null));
						    }
						}.sleep();
					  }

  • Author
5 minutes ago, Camaro said:

Fishing spots are actually NPCs, try that instead and see if its fixed

Lmao that worked. Thank you! it does spam the action until the animation starts. would i fix this with a sleep?

5 minutes ago, Kushitious said:

Lmao that worked. Thank you! it does spam the action until the animation starts. would i fix this with a sleep?

                new ConditionalSleep(Script.random(10000, 15000)) {
                    public boolean condition()
                            throws InterruptedException {
                        return !myPlayer().isAnimating(); <-- take the exclamation point away
                    }
                }.sleep();

And you should be good!

  • Author
2 minutes ago, Camaro said:

                new ConditionalSleep(Script.random(10000, 15000)) {
                    public boolean condition()
                            throws InterruptedException {
                        return !myPlayer().isAnimating(); <-- take the exclamation point away
                    }
                }.sleep();

And you should be good!

AH i had the ! there still. Thanks loads for the help!

15 minutes ago, Kushitious said:

AH i had the ! there still. Thanks loads for the help!

Last thing, you should only sleep if the interact was successful

             if (FISH.interact("Bait")) {
                new ConditionalSleep(Script.random(10000, 15000)) {
                    public boolean condition()
                            throws InterruptedException {
                        return !myPlayer().isAnimating();
                    }
                }.sleep();
             }

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.