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 problem

Featured Replies

Hello, I'm rewriting my script because I'm using too much WebWalking.

WalkingEvent toEdgeBank = new WalkingEvent(edgeBank);
                        toEdgeBank.setOperateCamera(true);
                        toEdgeBank.setEnergyThreshold(50);
                        toEdgeBank.setBreakCondition(new Condition() {
                            @Override
                            public boolean evaluate() {
                                return edgeBank.getRandomPosition().distance(myPlayer()) <= 6;
                            }
                        }).execute();

This is throwing a NullPointer and I have no idea why.

  • Author

Does "edgeBank" exist?

 

Have you set the Position before running the execute?

Area edgeBank = Banks.EDGEVILLE;

Thats what I have as a variable for edgeBank

do script.execute(event) , not event.execute()

 

That's what I tried before posting this. Still didn't work :s

Edited by GaetanoH

Area edgeBank = Banks.EDGEVILLE;

Thats what I have as a variable for edgeBank

 

That's what I tried before posting this. Still didn't work unsure.png

 

 

getBot().getEventExecutor().execute(EVENT_HERE);

 

this one works for me :)

Still can't get it to work...

I may be stupid for saying this but what benefit do you get out of using Area edgeBank = Banks.EDGEVILLE; 

 

cant you just set the event area as Banks.EDGEVILLE; without storing it?

 

 

also after setting the conditions i do

 

execute(eventName); 

  • Author

When I'm testing it, it seems that it never gets to setting the condition... Anyone an idea how that comes?

When I'm testing it, it seems that it never gets to setting the condition... Anyone an idea how that comes?

 

Depends what your code looks like now.

 

In the OP, the snippet posted would throw an nullpointer exception on setting the condition, because of the appended '.execute()'. calling execute on an event always throws NPE, because it is for the EventExecutor's internal use (and the executor sets some vars on the event before calling it).

 

Removing that, there's no way the snippet in the OP can throw an NPE, unless the area is null.

Edited by FrostBug

  • Author

Depends what your code looks like now.

 

In the OP, the snippet posted would throw an nullpointer exception on setting the condition, because of the appended '.execute()'. calling execute on an event always throws NPE, because it is for the EventExecutor's internal use (and the executor sets some vars on the event before calling it).

 

Removing that, there's no way the snippet in the OP can throw an NPE, unless the area is null.

 

Walking to the fishing spot works now, however walking back to the bank doesn't.

 WalkingEvent toEdgeBank = new WalkingEvent(Banks.EDGEVILLE);
                        toEdgeBank.setOperateCamera(true);
                        toEdgeBank.setEnergyThreshold(50);
                        toEdgeBank.setBreakCondition(new Condition() {
                            @Override
                            public boolean evaluate() {
                                return Banks.EDGEVILLE.getRandomPosition().distance(myPlayer()) <= 6;
                            }
                        });
                        getBot().getEventExecutor().execute(toEdgeBank);

 

Walking to the fishing spot works now, however walking back to the bank doesn't.

 WalkingEvent toEdgeBank = new WalkingEvent(Banks.EDGEVILLE);
                        toEdgeBank.setOperateCamera(true);
                        toEdgeBank.setEnergyThreshold(50);
                        toEdgeBank.setBreakCondition(new Condition() {
                            @Override
                            public boolean evaluate() {
                                return Banks.EDGEVILLE.getRandomPosition().distance(myPlayer()) <= 6;
                            }
                        });
                        getBot().getEventExecutor().execute(toEdgeBank);

 

Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging

Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6

 

Also, since this is the LocalWalker, make sure the position is actually loaded :E

Otherwise nothing's gonna happen.

Edited by FrostBug

  • Author

Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging

Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6

 

Also, since this is the LocalWalker, make sure the position is actually loaded :E

Otherwise nothing's gonna happen.

 

Removing the condition somehow got it working. Gonna try a few more times.

Nothing wrong with that code as far as I can tell. So it's probably not reached. Try logging

Also, in WalkingEvent you can use setMinDistanceThreshhold(6) instead of breaking at a radius of 6

 

Also, since this is the LocalWalker, make sure the position is actually loaded :E

Otherwise nothing's gonna happen.

 

What do you mean by loading the position?

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.