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.

Walking to a Sleeping Rock Crab

Featured Replies

Hi, I've noticed my script after walking to one of the dormant crabs on the far eastern side of the East side of rock crabs it kind of just gets stuck in that area and spams the logger with this, any help or ideas would be awesome.

Quote

[INFO][Bot #1][01/04 11:35:56 PM]: WebWalkingEvent; We have reached the final destination!

Here's the code.

package task.impl;

import org.osbot.rs07.api.model.NPC;

import Wrapper.Timing;
import script.RockCrab;
import task.Task;

public class FindCrab extends Task {
	@Override
	public boolean activate() {
		if (!RockCrab.Instance.combat.isFighting() && !RockCrab.Instance.myPlayer().isUnderAttack()) {
			return true;
		}
		return false;
	}

	@Override
	public void execute() {
		NPC rock = RockCrab.Instance.getNpcs().closest("Rocks");
		if (rock != null) {
			RockCrab.Instance.getCamera().toEntity(rock);
			rock.hover();
			RockCrab.Instance.getWalking().webWalk(rock.getPosition());
		}
		
		Timing.waitCondition(() -> RockCrab.Instance.myPlayer().isMoving(), 1000);
	}
}

I don't feel I need to be spoon fed just a push in the right direction if I'm doing something wrong =).

Also I've tried the walking#walk method also same issue.

Image below of issue:

https://gyazo.com/596f7031657fd2521fb5b38a50e41e7c

Edited by 01053

6 minutes ago, 01053 said:

Hi, I've noticed my script after walking to one of the dormant crabs on the far eastern side of the East side of rock crabs it kind of just gets stuck in that area and spams the logger with this, any help or ideas would be awesome.

Here's the code.


package task.impl;

import org.osbot.rs07.api.model.NPC;

import Wrapper.Timing;
import script.RockCrab;
import task.Task;

public class FindCrab extends Task {
	@Override
	public boolean activate() {
		if (!RockCrab.Instance.combat.isFighting() && !RockCrab.Instance.myPlayer().isUnderAttack()) {
			return true;
		}
		return false;
	}

	@Override
	public void execute() {
		NPC rock = RockCrab.Instance.getNpcs().closest("Rocks");
		if (rock != null) {
			RockCrab.Instance.getCamera().toEntity(rock);
			rock.hover();
			RockCrab.Instance.getWalking().webWalk(rock.getPosition());
		}
		
		Timing.waitCondition(() -> RockCrab.Instance.myPlayer().isMoving(), 1000);
	}
}

I don't feel I need to be spoon fed just a push in the right direction if I'm doing something wrong =).

Also I've tried the walking#walk method also same issue.

Image below of issue:

https://gyazo.com/596f7031657fd2521fb5b38a50e41e7c

 

Your FindCrab task will always execute unless isFighting or isUnderAttack is true.

In this case neither are true so it will continue to try and walk.

Web walking will not walk to the exact position you specify, it will stop walking a few tiles away. To walk to a closer tile / an exact tile you will need to use a custom WalkingEvent and set the minDistanceThreshold. The minDistanceThreshold specifies how close the player must be from the destination position before the WalkingEvent finishes.

You will also need to account for when mr crab does not wake up from his peaceful sleep. If the crab doesn't attack your player, then you will continue to execute the FindCrab task and try to walk.

Edited by Explv

  • Author
7 minutes ago, Explv said:

 

Your FindCrab task will always execute unless isFighting or isUnderAttack is true.

In this case neither are true so it will continue to try and walk.

Web walking will not walk to the exact position you specify, it will stop walking a few tiles away. To walk to a closer tile / an exact tile you will need to use a custom WalkingEvent and set the minDistanceThreshold. The minDistanceThreshold specifies how close the player must be from the destination position before the WalkingEvent finishes.

You will also need to account for when mr crab does not wake up from his peaceful sleep. If the crab doesn't attack your player, then you will continue to execute the FindCrab task and try to walk.

Hey thanks for the reply. I'll give it a try. :)

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.