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.

Itemdefinition noted & unnoted id bug

Featured Replies

I'm getting some really strange results for noted and unnoted ids using the item definition API.

 

Using the following code I got the following results:

import org.osbot.rs07.api.def.ItemDefinition
import org.osbot.rs07.script.Script
import org.osbot.rs07.script.ScriptManifest

/**
 * Created by ....
 */
@ScriptManifest(author = "Xerion", name = "Secret project", version = 0.0, info = "", logo = "")
class StakerScript : Script() {

    @Throws(InterruptedException::class)
    override fun onLoop(): Int {
        try {
            val definition1 = ItemDefinition.forId(1511)
            System.out.println("item id: 1511")
            System.out.println("Noted id: " + definition1.notedId)
            System.out.println("Unnoted id: " + definition1.unnotedId)
            val definition2 = ItemDefinition.forId(1512)
            System.out.println("item id: 1512")
            System.out.println("Noted id: " + definition2.notedId)
            System.out.println("Unnoted id: " + definition2.unnotedId)
        }catch (e : Exception){
            e.printStackTrace()
        }
        return 150
    }

    override fun onStart() {

    }

}

Please note this is coded in Kotlin.

 

Results:

item id: 1511
Noted id: -1
Unnoted id: 1512

item id: 1512
Noted id: 799
Unnoted id: 1511

The item used was an oak log and both the items (noted & unnoted) were in my inventory. The noted and unnoted ids seem to be completely wrong and not give the results back I expected.

 

ps. Additionally it might be handy to add an isNoted method to the item definition class. 

  • Author

I'm getting a different id for oak logs:

 

5416d0fccaba3df4db6ca6224b6173b9.png

 

Sorry, in the original post I used normal logs instead of oak logs. I tested it again today with both normal and oak logs and I get same strange and odd results

item id: 1511
Noted id: -1
Unnoted id: 1512
item id: 1512
Noted id: 799
Unnoted id: 1511
item id: 1521
Noted id: -1
Unnoted id: 1522
item id: 1522
Noted id: 799
Unnoted id: 1521

When I use the inventory debugger everything seems to be alright, yet I still have messed up noted and unnote ids when using the kotlin code.

 

2016-08-24_20-06-07.png

 

I'm using the latest osbot client (2.4.84) running stealth injection mode. 

Sorry, in the original post I used normal logs instead of oak logs. I tested it again today with both normal and oak logs and I get same strange and odd results

item id: 1511
Noted id: -1
Unnoted id: 1512
item id: 1512
Noted id: 799
Unnoted id: 1511
item id: 1521
Noted id: -1
Unnoted id: 1522
item id: 1522
Noted id: 799
Unnoted id: 1521

When I use the inventory debugger everything seems to be alright, yet I still have messed up noted and unnote ids when using the kotlin code.

 

2016-08-24_20-06-07.png

 

I'm using the latest osbot client (2.4.84) running stealth injection mode. 

 

Had the same issue, but did this and it worked for me:

private boolean isNoted(GroundItem item) {
		return item != null && item.getDefinition() != null && item.getDefinition().getUnnotedId() != -1 && item.getId() > item.getDefinition().getUnnotedId();
	}

private int getUnnotedID(GroundItem item) {
		if(item != null) {
			if(isNoted(item)) {
				return item.getDefinition().getUnnotedId();
			}
			return item.getId();
		}
		return -1;	
	}

I know this is for ground items, but may apply to items too.

Edited by Precise

I'm drowning in SDN management work right now, I'll take a look either later today or tomorrow.

  • Author

Had the same issue, but did this and it worked for me:

private boolean isNoted(GroundItem item) {
		return item != null && item.getDefinition() != null && item.getDefinition().getUnnotedId() != -1 && item.getId() > item.getDefinition().getUnnotedId();
	}

private int getUnnotedID(GroundItem item) {
		if(item != null) {
			if(isNoted(item)) {
				return item.getDefinition().getUnnotedId();
			}
			return item.getId();
		}
		return -1;	
	}

I know this is for ground items, but may apply to items too.

 

I know how I can get the correct results (which I already did). The problem is that variables don't return results you expect. The noted id of a noted (oak) log shouldn't be 799 and the unnoted id of an unnoted item shouldn't be the noted item.

 

I'm kinda surprised that nobody has reported this before. I'm also afraid if this bug is resolved that some scripts will break, because scripters decided work around this bug incorrectly instead of reporting it and getting it fixed.

 

EDIT: Ground items use the item definitions so you are correct that they are the same. 

Edited by Xerion

Guest
This topic is now closed to further replies.

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.