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.

WalkingEvent GroundItem

Featured Replies

GroundItem khaleesi= getGroundItems().closest(gI -> gI.getName().equals("Khaleesi") && gI.hasAction("Touch"));
WalkingEvent walkingEvent = new WalkingEvent(khaleesi);
walkingEvent.setBreakCondition(new Condition() {
	@Override
	public boolean evaluate() {
	return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3;
	}
});
execute(walkingEvent);

When doing above, it is not going to walk to the ground item but when i do following;

WalkingEvent walkingEvent = new WalkingEvent(khaleesi.getPosition());
walkingEvent.setBreakCondition(new Condition() {
	@Override
	public boolean evaluate() {
	return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3;
	}
});
execute(walkingEvent);

It does walk, so, any reason why WalkingEvent needs .getPosition() for GroundItems for it to walk to it ?

Edited by iJodix

GroundItem khaleesi= getGroundItems().closest(gI -> gI.getName().equals("Khaleesi") && gI.hasAction("Touch"));
WalkingEvent walkingEvent = new WalkingEvent(khaleesi);
walkingEvent.setBreakCondition(new Condition() {
	@Override
	public boolean evaluate() {
	return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3;
	}
});
execute(walkingEvent);

When doing above, it is not going to walk to the ground item but when i do following;

WalkingEvent walkingEvent = new WalkingEvent(khaleesi.getPosition());
walkingEvent.setBreakCondition(new Condition() {
	@Override
	public boolean evaluate() {
	return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3;
	}
});
execute(walkingEvent);

It does walk, so, any reason why WalkingEvent needs .getPosition() for GroundItems for it to walk to it ?

 

I never tried to walk to an entity but I guess it searches for a walkable position around the entity first so it can generate a path (walking to an unwalkable tile will result in no path found), the method which walks to an entity might simply be broken. Walking to a position is considered "lower level" than walking to an entity so it is generally more stable... but why are you trying to touch @Khaleesi ... :ph34r:

  • Author

I never tried to walk to an entity but I guess it searches for a walkable position around the entity first so it can generate a path (walking to an unwalkable tile will result in no path found), the method which walks to an entity might simply be broken. Walking to a position is considered "lower level" than walking to an entity so it is generally more stable... but why are you trying to touch @Khaleesi ... ph34r.png

Well, it works for entity/objects but doesn't want to work for Ground items and who wouldn't want to touch Khaleesi boge.png

Well, it works for entity/objects but doesn't want to work for Ground items and who wouldn't want to touch Khaleesi boge.png

Does it work for NPC?

  • Author

Does it work for NPC?

Yes, works for everything else expect GroundItem

Yes, works for everything else expect GroundItem

Even GroundDecoration? :troll: Lol kidding, maybe there is something different in clipping flags for tiles containing GroundItem which the walking code does not handle. I never use anything but the position one because its definately the most stable one. If that one produces an error then all others will 100% be broken too.

  • Author

Even GroundDecoration? Troll.png Lol kidding, maybe there is something different in clipping flags for tiles containing GroundItem which the walking code does not handle. I never use anything but the position one because its definately the most stable one. If that one produces an error then all others will 100% be broken too.

Well, i'm fine with adding .getPosition(), was just wondering why it doesn't work without .getPosition() boge.png

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.