Skip 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 exact position.

Featured Replies

I have found some useful information about walking to exact position, for example this thread:

 

Unfortunately I can't get the syntax correct and I think it is because I am using this method of writing:

https://osbot.org/forum/topic/92612-tutorialindepth-a-better-take-on-task-based-scripts/

If I use the syntax found in the thread or try and make my own WalkingEvent:

 WalkingEvent digsite = new WalkingEvent(EVarrockMinePos);

 digsite.setMinDistanceThreshold(0);

 script.execute(digsite);

It rejects it saying script can not be resolved. Nor does is like:

 

api.script.execute(digsite)

 

This code gets passed over, I don't get an error, nothing happens:

WalkingEvent digsite = new WalkingEvent(EVarrockMinePos);
digsite.setMinDistanceThreshold(0);
api.execute(digsite);

 

 

Anyone want to give me a hint as to what I am doing wrong?

You probably need to pass a script reference to execute events instead of a MethodProvider, but I've always passed Script regardless so not sure.

  • Author
43 minutes ago, Night said:

You probably need to pass a script reference to execute events instead of a MethodProvider, but I've always passed Script regardless so not sure.

If you were to guess how this could be done, what would you guess?

just use onloop in the main script class

easier then getting confused with these "task based" solutions

16 minutes ago, sudoinit6 said:

If you were to guess how this could be done, what would you guess?

Just pass your Script object from main class through the constructor of your task.

  • Author
1 hour ago, Chris said:

just use onloop in the main script class

easier then getting confused with these "task based" solutions

I am too dumb to do that.

 

1 hour ago, Night said:

Just pass your Script object from main class through the constructor of your task.

I will give that a try, thanks.

 

5 minutes ago, Juggles said:

Also remember walkingevent will only work for the loaded area.

you can't do it for long distances

How far is the "loaded area" I am trying to go from Varrock Bank West to Varrock East Mine.

Just now, sudoinit6 said:

I am too dumb to do that.

 

I will give that a try, thanks.

 

How far is the "loaded area" I am trying to go from Varrock Bank West to Varrock East Mine.

Way too far. 

Only about 20 tiles in every direction (what your minimap can see)

in your main class, the class that 'extends Script' (at the top of the file), add a custom method like this:

	    public void longwalk(Position target) {
        WebWalkEvent event = new WebWalkEvent(target);
        execute(event);
    }
	

Then in your tasks/events you can just call that method, of course don't forget to add a target position. If you want to walk to an AREA instead of a position, you can change "Position target" to "Area target"

  • Author
12 minutes ago, Juggles said:

Way too far. 

Only about 20 tiles in every direction (what your minimap can see)

Well damn, that could be my problem. Thanks mate!

 

2 minutes ago, Czar said:

in your main class, the class that 'extends Script' (at the top of the file), add a custom method like this:

 


	    public void longwalk(Position target) {
        WebWalkEvent event = new WebWalkEvent(target);
        execute(event);
    }
	

 

Then in your tasks/events you can just call that method, of course don't forget to add a target position. If you want to walk to an AREA instead of a position, you can change "Position target" to "Area target"

Gotcha, I will try starting from closer and this. You guys rock, thanks again!

  • Author
26 minutes ago, Czar said:

in your main class, the class that 'extends Script' (at the top of the file), add a custom method like this:

 


	    public void longwalk(Position target) {
        WebWalkEvent event = new WebWalkEvent(target);
        execute(event);
    }
	

 

Then in your tasks/events you can just call that method, of course don't forget to add a target position. If you want to walk to an AREA instead of a position, you can change "Position target" to "Area target"

When I do this and call upon it, the IDE wants me to make longwalk static, and then I get an error on execute that say I can't make a static reference to a not static method from the type MethodProvider.

  • Author

Solved! Thank you all for your help! It was a combination of your advice, putting it in the main class and I was too far away so I started closer. Those did the trick!

 

 

WalkingEvent uses LocalWalker, which uses the local region clipping graph. This is 104x104 tiles (13 by 13 chunks), so a bit more than just 20 tiles in each direction.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.