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.

issues using getAmount() method

Featured Replies

Trying to make my 1st script and having issues identifying an amount of item in my inventory by the ID.  I read the API and found the getAmount() method but I cant seem to properly pass it the correct parameters. Ive been able to get it to successfully take the correct item ID (I think) but I cant seem to get it to interact with the correct container.

	long copperAmount = 0;
	
	public long getAmount(int... ids){
		return copperAmount;
	}

	public final String copperOreAmount(final long ms){
    	long amt = getAmount(436);
   		return String.format("%02d", amt);
}	

I have code in my onPaint() that prints out the result of copperAmount that looks like this to debug the results

g.drawString(copperOreAmount(getAmount()), 300, 300);

It will only print out 0 even though I have the item in my inventory and i'm worried that my print statement may be incorrect or that i may be inputting the parameters of getAmount() incorrectly or if my return statement is incorrect or something im missing entirely. ive also tried typing it is Inventory.getAmount() to ensure it was pulling from the inventory container and not just interacting with nothing but it gave me an error about a static method interacting with a non static method but when i made everything static it would just throw the same error.

Edited by vladbuff

  • Author

realized i was being an idiot and just not using it correctly looked through other threads in this section

  • Muffins locked this topic
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.