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.

RandomBehaviourHook not working correctly?

Featured Replies

Hey, I just made my first script for OSBot, I mus say, it is an awesome bot!

Earlier today I found out about the random management system, which I thought would serve great in my script. I made this behaviour hook for the MILES_GILES_NILES random.

        randomManager.registerHook(
                new RandomBehaviourHook(RandomManager.MILES_GILES_NILES) {

                    @Override
                    public boolean shouldActivatePreLoop() {
               
                        return client.getMyPlayer().isInArea(dArea);
                    }

                    @Override
                    public int preLoop() throws InterruptedException {
                    	walkMiniMap(new Position(2822, 9826, 0));
                    	log("pre loop");
            			sleep(400);
                        return gRandom(600, 300);
                    }

                }
        );

As soon as I got the random in-game the bot started throwing these errors + went stuck.

[ERROR][05/30/13 02:47:42 PM]: Error on executing random worker!
java.lang.NullPointerException
	at org.osbot.script.Script.getName(ri:37)
	at org.osbot.script.rs2.randoms.RandomManager.scan(og:91)
	at org.osbot.eb.run(qh:219)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

What did I do wrong?

 

 

Thanks in advance!

 

Edited by Quint

  • Developer

This could be something I overlooked when I wrote it, I'll get back to you about this asap.

 

Edit: It seems as I've forgotten to let the hook wrap the annotation with an adapter. I'll push an update for this in a couple of hours when I get back home.

  • Author

Thanks Maxi :)

Guest
This topic is now closed to further replies.

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.