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.

I'm worst scripter ever pls halp

Featured Replies

Below I will show my onLoop() method. What I am trying to do is make it so when you log in, it checks for the item first, then picks it up, then hops. What it's doing right now is just logging in and hopping right away. :\ 

 

Also I apologize if this is not in the appropriate section I am new here :)

 

public int onLoop() throws InterruptedException {
 
worldHopper.hopWorld(world);
sleep(2000);
Player c = client.getMyPlayer();
 
 
Entity chisel = closestGroundItemForName("Chisel");
 
if (chisel != null) {
if (chisel.isVisible()) {
if (!c.isAnimating()) {
if (!c.isMoving()) {
chisel.interact("Take");
sleep(random(500, 700));
}
}
} else {
client.moveCameraToEntity(chisel);
}
}
 
return 50;
 
 
}

 

 

 

 

  • Author

That's because you call 'worldHopper.hopWorld(world); ' first.

 

I've tried this:

 

 

 

public int onLoop() throws InterruptedException {

 
Player c = client.getMyPlayer();
 
Entity chisel = closestGroundItemForName("Chisel");
 
if (chisel != null) {
if (chisel.isVisible()) {
if (!c.isAnimating()) {
if (!c.isMoving()) {
chisel.interact("Take");
sleep(random(500, 700));
}
}
} else {
client.moveCameraToEntity(chisel);
}
 
worldHopper.hopWorld(world);
sleep(2000);
}
 
return 50;
 
}

 

As well as a few other ways but it still seems to do the same thing sad.png

Edited by DJay

worldHopper.hopWorld(world);

sleep(2000);

 

 

add that inside your if statement so it will only execute if it picks up the chisel.

  • Author

 

worldHopper.hopWorld(world);
sleep(2000);
 
 
add that inside your if statement so it will only execute if it picks up the chisel.

 

 

 

Thanks! Works now! :):)

 

Didn't think of that o.o

    public int onLoop() throws InterruptedException {
        Player c = client.getMyPlayer();


        GroundItem chisel = closestGroundItemForName("Chisel");

        if (chisel != null && chisel.exists()) {
            if (chisel.isVisible()) {
                chisel.interact("Take");
                sleep(random(500, 700));
            } else {
                client.moveCameraToEntity(chisel);
            }
        } else {
            worldHopper.hopWorld(world);
        }
        return 50;
    }
}

Try that.

  • Author

 

worldHopper.hopWorld(world);
sleep(2000);
 
 
add that inside your if statement so it will only execute if it picks up the chisel.

 

 

I have one more question. I'm using this method to hop worlds: http://osbot.org/forum/topic/4942-for-everyone-hopping-worlds-in-their-scripts/

 

But I think I'm missing something because it hops once, but the next time it goes to hop it just logs into the same world over and over. Any ideas? I feel like I'm missing something.

  • Author
Make your 'world' variable random each time. Beware of world features though (i.e., if it must be members etc. If that's the case then you should create an array of possible worlds and randomly select one out of those)!

 

 

 

int world = WORLDS[random(WORLDS.length -1)];

 

It's like that atm. It goes to "Random event: World hopping" then stops and goes to "Random event: logging in". Weird :s

 

It switches to random event logging in before hopping worlds.

Edited by DJay

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.