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.

Walk to position not working

Featured Replies

I've been trying to find out whats wrong but i just can't find the mistake.

If i'm on the tile where i'm trying to go, nothing happens. ( this is correct )

But if i'm not on the tile all i see is the "Returning to exact AFK spot." get spammed on log and my character doesn't walk there.

Can someone point me to the right direction?

 

This is on my getState:

if (afk.contains(myPlayer()) && !(myPlayer().getX() == 2704) && !(myPlayer().getY() == 3726))
			return State.AFKSPOT;

Position:

Position afkspot = new Position(2704, 3726, 0);

And this is my AFKSPOT case:

case AFKSPOT:
    		getWalking().walk(afkspot);
    		log("Returning to exact AFK spot.");
    		sleep(random(345, 825));
    		break;

 

If you want to walk to an exact position you will need to use a custom WalkingEvent  and change the distance threshold to 0. By default the value is 3, which means the player will stop walking when <= 3 tiles away from the destination (getWalking().walk() just uses the default settings)

WalkingEvent walkingEvent = new WalkingEvent(afkspot);
walkingEvent.setMinDistanceThreshold(0);
execute(walkingEvent);

 

Edited by Explv

10 minutes ago, JARNQ said:

I've been trying to find out whats wrong but i just can't find the mistake.

If i'm on the tile where i'm trying to go, nothing happens. ( this is correct )

But if i'm not on the tile all i see is the "Returning to exact AFK spot." get spammed on log and my character doesn't walk there.

Can someone point me to the right direction?

 

This is on my getState:


if (afk.contains(myPlayer()) && !(myPlayer().getX() == 2704) && !(myPlayer().getY() == 3726))
			return State.AFKSPOT;

Position:


Position afkspot = new Position(2704, 3726, 0);

And this is my AFKSPOT case:


case AFKSPOT:
    		getWalking().walk(afkspot);
    		log("Returning to exact AFK spot.");
    		sleep(random(345, 825));
    		break;

 

Why are you doing:

!(myPlayer().getX() == 2704)

Wouldn't:

myPlayer().getX() != 2704

Be better?

As for your question you need to do something like so:

WalkingEvent walkToSpot = new WalkingEvent(afkspot);
walkToSpot.setMinDistanceThreshold(0); 
execute(walkToSpot);

 

Edited by harrypotter

4 minutes ago, harrypotter said:

Why are you doing:


!(myPlayer().getX() == 2704)

Wouldn't:


myPlayer().getX() != 2704

Be better?

 

Nah man that's top tier antiban

4 minutes ago, harrypotter said:

Why are you doing:


!(myPlayer().getX() == 2704)

Wouldn't:


myPlayer().getX() != 2704

Be better?

 

This would be better:

!myPosition().equals(afkspot);

 

16 minutes ago, Explv said:

If you want to walk to an exact position you will need to use a custom WalkingEvent  and change the distance threshold to 0. By default the value is 3, which means the player will stop walking when <= 3 tiles away from the destination (getWalking().walk() just uses the default settings)


WalkingEvent walkingEvent = new WalkingEvent(afkspot);
walkingEvent.setMinDistanceThreshold(0);
execute(walkingEvent);

 

This^

 

1 minute ago, Khaleesi said:

This^

i know java css html php if i take some time learning osbot scripting can i make scripts?? ugh

  • Author
1 hour ago, harrypotter said:

Why are you doing:


!(myPlayer().getX() == 2704)

Wouldn't:


myPlayer().getX() != 2704

Be better?

As for your question you need to do something like so:


WalkingEvent walkToSpot = new WalkingEvent(afkspot);
walkToSpot.setMinDistanceThreshold(0); 
execute(walkToSpot);

 

 

Yes sir it would.

I'm pretty new to java so alot of my code is questionable. :P

1 hour ago, Explv said:

If you want to walk to an exact position you will need to use a custom WalkingEvent  and change the distance threshold to 0. By default the value is 3, which means the player will stop walking when <= 3 tiles away from the destination (getWalking().walk() just uses the default settings)


WalkingEvent walkingEvent = new WalkingEvent(afkspot);
walkingEvent.setMinDistanceThreshold(0);
execute(walkingEvent);

 

Oh alright, i see.

 

Thanks alot! :)

also afkspot.interact(bot, "Walk here");

dunno how well it goes against what others have said but it works for me

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.