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.

Problems with hopping worlds

Featured Replies

Hello, I'm recently experiencing issues with hopping worlds, although 2 days ago it worked flawlessly in testing. It seems to not scroll to the world tab menu and also not click on the next world as stated. I tried opening the world selector before starting my script but nothing seemd to do the job. Is my script suddenly broken or is it something with OSBot what's causing this?

 

(I'm kinda new into scripting, also without any programming experience, so I'm here just testing the waters so please don't offend me in the way I code things lmao, I'm already happy if it does the job :) )

        // Hop to the next world
        log ("Time to hop!");
        sleep(random(1500,2500));

        getWidgets().closeOpenInterface();
        
        sleep(random(300,500));

        getLogoutTab().open();

        while (getLogoutTab().isOpen()) {

            if (worlds.getCurrentWorld() == 302) {
                worlds.hop(303);
            }
            if (worlds.getCurrentWorld() == 303) {
                worlds.hop(304);
            }
            if (worlds.getCurrentWorld() == 304) {
                worlds.hop(305);
            }

etc etc

 

There's a bunch of things here.

1) Never user a while loop in a script. There's always an alternative.

2) You don't need to explicitly close most interfaces or open a tab for world hopping.

3) You should use if else statements wherever possible.

Realistically, your script should look something like:
 

        log("Time to hop!");
        if(getWorlds().getCurrentWorld() == 302){
            if(worlds.hop(303)){
                Sleep.sleepUntil(() -> getWorlds().getCurrentWorld() == 303, 5_000);
            }
        }else if(getWorlds().getCurrentWorld() == 303){
            if(worlds.hop(304)){
                Sleep.sleepUntil(() -> getWorlds().getCurrentWorld() == 304, 5_000);
            }
        }

You could also use a switch statement, or make a nice clean algorithm for the next members worlds in the list, but I'm too lazy to write that.

  • Author
11 hours ago, Naked said:

There's a bunch of things here.

1) Never user a while loop in a script. There's always an alternative.

2) You don't need to explicitly close most interfaces or open a tab for world hopping.

3) You should use if else statements wherever possible.

Realistically, your script should look something like:
 


        log("Time to hop!");
        if(getWorlds().getCurrentWorld() == 302){
            if(worlds.hop(303)){
                Sleep.sleepUntil(() -> getWorlds().getCurrentWorld() == 303, 5_000);
            }
        }else if(getWorlds().getCurrentWorld() == 303){
            if(worlds.hop(304)){
                Sleep.sleepUntil(() -> getWorlds().getCurrentWorld() == 304, 5_000);
            }
        }

You could also use a switch statement, or make a nice clean algorithm for the next members worlds in the list, but I'm too lazy to write that.

Thanks a lot Naked :D , the while loop probably broke my script and it seems to be working perfectly after adjusting to what you sent me. This will keep me away from upcoming obstacles in the future hopefully.

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.