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.

How to determine if an item is a "Members object"

Featured Replies

When in a F2P world, members items become "Members object". However, the getName method (as seen below) still returns the item's real name (ex. Dragon dagger) and not "Members object"
 

getBank().getItemInSlot(currentBankItem).getName()

How do I determine if an item is a "Members object" or not?

Edit: Valid answers from this thread:

 

 

Edited by Adept
Included valid answers for quick reference

You could try a lamda expression of 

 f-> f.containsName("Members"); 


Not sure if it'll work but its worth a shot. 

  • Author
13 minutes ago, Juggles said:

You could try a lamda expression of 


 f-> f.containsName("Members"); 


Not sure if it'll work but its worth a shot. 

I have no clue how to use that and Google isn't helping much. Could you kindly provide some context or provide a clearer example?

9 minutes ago, Adept said:

I have no clue how to use that and Google isn't helping much. Could you kindly provide some context or provide a clearer example?

getBank().contains("Members object") ?

  • Author
3 minutes ago, Ayylmao420 said:

getBank().contains("Members object") ?

Not relevant. Kindly revisit the question. I want to check if the item in a particular slot is a "Members object".

Edited by Adept

1 minute ago, Adept said:

Not relevant. Kindly revisit the question. I want to check if a particular item in a particular slot is a "Members object".

getBank().getItemInSlot(getBank().getSlot(item name)).getName().contains("Members object"); ?

  • Author
5 minutes ago, Ayylmao420 said:

getBank().getItemInSlot(getBank().getSlot(item name)).getName().contains("Members object"); ?

I quote myself:

42 minutes ago, Adept said:

 However, the getName method returns the item's real name (ex. Dragon dagger) and not "Members object"

In your opinion, does the string "Dragon dagger" contain "Members object"?

Edited by Adept

  • Author
6 hours ago, Diclonius said:

Check out the ItemDifinition, there may be some more details there. Alternatively you could check the ID against a list or API e.g. http://mooshe.pw/files/items_osrs.json 

I tried making use of ItemDefinition but couldn't figure out a way. Maybe I'm missing something.
The API though! That's more like it! Thank you!

4 minutes ago, Adept said:

I tried making use of ItemDefinition but couldn't figure out a way. Maybe I'm missing missing.
The API though! That's more like it! Thank you!

No problem, hope it helps!

1 hour ago, Adept said:

When in a F2P world, members items become "Members object". However, the getName method (as seen below) still returns the item's real name (ex. Dragon dagger) and not "Members object"
 


getBank().getItemInSlot(currentBankItem).getName()

How do I determine if an item is a "Members object" or not?

 

I'm not sure if there is a better solution, but this would work:

getInventory().getItemInSlot(0).hover();
if (getMenuAPI().getTooltip().contains("Members object")) {
    // item is members
}

Essentially, it hovers the mouse over the item, then checks the tooltip message

Edited by Explv

  • Author
17 minutes ago, Explv said:

 

I'm not sure if there is a better solution, but this would work:


getInventory().getItemInSlot(0).hover();
if (getMenuAPI().getTooltip().contains("Members object")) {
    // item is members
}

Essentially, it hovers the mouse over the item, then checks the tooltip message

Not sure why it's throwing a NullPointer Exception. But it looks like the solution I was hoping for. Thank you!
Edit: I'm retarded. Was using getInventory() instead of getBank()
I'm tremendously grateful, Explv!

Edited by Adept

Just now, Adept said:

Not sure why it's throwing a NullPointer Exception. But it looks like the solution I was hoping for. Thank you!

You need to make sure there is an item in the slot (in my example the first slot), otherwise it will throw an NPE.

You will also need to check that the hover() method was successful, because if the mouse is not hovering over the item, then the tooltip will be null.

 

5 minutes ago, Adept said:

Edit: I'm retarded. Was using getInventory() instead of getBank()
I'm tremendously grateful, Explv!

No problem.

What exactly is your use case for this? 

  • Author
33 minutes ago, Explv said:

What exactly is your use case for this? 

Withdrawing all items from the bank and selling them to GE. Don't want to withdraw "Members object".
Using it to clean worker accounts.

Edit: Prior to hovering the item, I will need to make sure it's visible by scrolling to it. I'm looking at the Bank API but can't understand the difference between a slot, a tabSlot and an absoluteSlot. Could someone clarify, please?

Edited by Adept

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.