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.

if(client.getInventory) Problem

Featured Replies

Hello,

I'm new to coding, like today new... I've only just learnt how to install and set up Eclipse! 

 

But now well on my way to (Attempting) to code a Woodcutting script. 

 

I have ran into my first problem it seems... 

 

When trying to write a line of code for:

if ( Client.getInventory().isFull(){

 

}

 

My code doesn't seem to want to pick up the client at all? I feel like I have set up Eclipse well and added the OSB client correct following a guide here, so what could be my issue?

 

Appreciate the help,

 

It's all love

Annotation 2020-05-24 171425.png

You don't need to use "Client."

You can use "Inventory.isFull()" or "getInventory().isFull()".

You can do something like this:

    private void drop() throws InterruptedException {
        
    	if  (getInventory().isFull()) {
             getInventory().dropAllExcept("Rune axe");
            sleep(random(50, 105));
			new ConditionalSleep(5000, 600) {
			    @Override
			    public boolean condition() {
			        return (getInventory().isEmptyExcept("Rune axe"));
			    }
			}.sleep();
        } else {
            stop(false);
        }
    }

Furthermore, when using Eclipse you can press "cntrl+space" and it'll give you all possible options for what you're trying. So if you type "getInven" and pres cntrl+space, it'll show "getInventory()", and after you type ".", it'll show everything like "getInventory.isFull" "getInventory.isEmpty", etc.

Edited by Lol_marcus

  • Author

I see, thank you very much for that! So it's kinda optional?

 

This video guide I'm watching to create the script and learn 10:40 says to use client so I can carry on and just adjust the step as you say

 

6 minutes ago, Conscious Realm said:

I see, thank you very much for that! So it's kinda optional?

 

This video guide I'm watching to create the script and learn 10:40 says to use client so I can carry on and just adjust the step as you say

 

This guide is 7 years old, API's been updated since then :)

 

 

  • Author
1 minute ago, D9BLADEE said:

This guide is 7 years old, API's been updated since then :)

 

 

Damn... I learn by following things like step by step coding the script like this and there doesn't appear to be recent coding videos like this one?

 

 

I highly recommend these 2 videos, as well as the tutorials in the tutorial section by Apaec and Explv.

1 hour ago, Lol_marcus said:

I highly recommend these 2 videos, as well as the tutorials in the tutorial section by Apaec and Explv.

+1 to Explv as it is what I started on

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.