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.

Pick up specific item after killing NPC

Featured Replies

Hey all, 

I recently started with Java coding and I'm fooling around now for my own learning purposes, I'm trying to make an easy Imp killer/looter but the looting part isn't working..

The imps will get killed, however when they drop a bead (either black white yellow or red) it just wont pick it up.. Why ?

 

I have this code in the onLoop: (Yes I know I should probably be using cases)

if(!inventory.isFull() && getGroundItems().closest("Black bead", "White bead", "Red bead", "Yellow bead") != null) {
			
			getGroundItems().closest("Black bead").interact("Take");
			getGroundItems().closest("White bead").interact("Take");
			getGroundItems().closest("Red bead").interact("Take");
			getGroundItems().closest("Yellow bead").interact("Take");
			
		} else if(!inventory.isFull() && getNpcs().closest("Imp") != null && !myPlayer().isUnderAttack()) {
			
			getNpcs().closest("Imp").interact("Attack");
			sleep(random(300, 700));
			
		}

 

This is a code from my scheme bot .

 

                arr= {"Black bead", "White bead", "Red bead", "Yellow bead"}

                GroundItem ff = Scheme.scemeBot.getGroundItems().closest(arr);
                int emptySlots = Scheme.scemeBot.getInventory().getEmptySlots();
                if (ff!=null&&ff.interact("Take")) {
                    Sleep.sleepUntil(() -> {
                        return Scheme.scemeBot.getInventory().getEmptySlots() < emptySlots || Scheme.scemeBot.getGroundItems().closest(arr) == null;
                    }, 5000);
                }

             

 

 

 

P.S.

You should always null check Things that return objects

getNpcs().closest()

 

Look in to condition sleeps

 

 

 

Edited by Nbacon

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.