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.

Show Item IDs In Inventory & Equipment Source Code

Featured Replies

  • Author

Updated the code. Now simpler and a little better. smile.png Enjoy

Edited by TheAnswer

Why are you running 2 separate selectors?

if(currentTab() == Tab.INVENTORY)
{
	...
}
if(currentTab() == Tab.EQUIPMENT)
{
	...
}

Only one tab can be opened at any given time, so use else if for the 2nd selector, else if the first selector is true (inventory), you will also be redundantly checking to see if the equipment tab is open as well.

 

 

 

Also, the fuck is this?:

    if(currentTab() == Tab.INVENTORY)
    {
       ...
            if(currentTab() != Tab.INVENTORY)
                return;
       ...
    }
    if(currentTab() == Tab.EQUIPMENT)
    {
        ...
            if(currentTab() != Tab.EQUIPMENT)
                return;
        ...
    }

You don't need to check to see if we're not in the inventory tab once we've already checked to see if we're in the damn inventory tab.

Same for the equipment tab.

Edited by liverare

Very useful! Thank you so much for this. Many will appreciate this.

  • Author

Why are you running 2 separate selectors?

if(currentTab() == Tab.INVENTORY)
{
	...
}
if(currentTab() == Tab.EQUIPMENT)
{
	...
}

Only one tab can be opened at any given time, so use else if for the 2nd selector, else if the first selector is true (inventory), you will also be redundantly checking to see if the equipment tab is open as well.

 

 

 

Also, the fuck is this?:

    if(currentTab() == Tab.INVENTORY)
    {
       ...
            if(currentTab() != Tab.INVENTORY)
                return;
       ...
    }
    if(currentTab() == Tab.EQUIPMENT)
    {
        ...
            if(currentTab() != Tab.EQUIPMENT)
                return;
        ...
    }

You don't need to check to see if we're not in the inventory tab once we've already checked to see if we're in the damn inventory tab.

Same for the equipment tab.

 

Haha. Dam my bad on the if, else thing failed when doing the formatting. Thanks for pointing it out.

 

Anyway ,the "return" I added, is to break out of the for loop and exit the method so it can do other things, and not sit there going through the rest of the for loop painting the ID's when the tab has changed. I know the for loop is small and you wont notice the difference, but I added as practice for myself and is really useful with big for loops etc. You can also use a break if you just want to exit the for loop prematurely.

Guest
This topic is now closed to further replies.

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.