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.

GE Data (get price etc. by item name) no external libraries required

Featured Replies

Thanks for the tutorial! 

 

How could I identify what ground item has been picked up and get the price of that item using this?

 

I have an array of items the script picks up but haven't been able to figure out how exactly to document the profit being made..

 

EDIT: NVM, got it.

Edited by Temsei

  • 1 month later...

I'm making use of the ExchangeItem.java class multiple times throughout my code. On some occasions, fetching the price works and other times all price checks simply return 0.
Here's an example of price checks which return 0:
 

		Item[] inventoryItems = getInventory().getItems();
                    int j;
                    for(j = 0; j < inventoryItems.length; j++){
                        Item currentItem = inventoryItems[j];
                        if (currentItem != null) {
                            log("currentItem: " + currentItem.toString());
                            int jId = currentItem.getId();
                            String jName = currentItem.getName();
                            ExchangeItem jItem = new ExchangeItem(jName, jId);
                            int jPrice = jItem.getPrice();
                            log("Price: " + jPrice); //returns 0
                        }
                    }

Log example:
 

[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 995, Name: Coins, Amount: 8000
[INFO][Bot #1][02/22 12:54:38 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 12288, Name: Mithril platebody (t), Amount: 1
[INFO][Bot #1][02/22 12:54:38 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 1051, Name: Santa hat, Amount: 17
[INFO][Bot #1][02/22 12:54:39 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:39 AM]: currentItem: Item id: 6740, Name: Dragon axe, Amount: 11
[INFO][Bot #1][02/22 12:54:39 AM]: Price: 0

Why is this happening?

Edited by Adept

  • Author
13 hours ago, Adept said:

I'm making use of the ExchangeItem.java class multiple times throughout my code. On some occasions, fetching the price works and other times all price checks simply return 0.
Here's an example of price checks which return 0:
 


		Item[] inventoryItems = getInventory().getItems();
                    int j;
                    for(j = 0; j < inventoryItems.length; j++){
                        Item currentItem = inventoryItems[j];
                        if (currentItem != null) {
                            log("currentItem: " + currentItem.toString());
                            int jId = currentItem.getId();
                            String jName = currentItem.getName();
                            ExchangeItem jItem = new ExchangeItem(jName, jId);
                            int jPrice = jItem.getPrice();
                            log("Price: " + jPrice); //returns 0
                        }
                    }

Log example:
 


[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 995, Name: Coins, Amount: 8000
[INFO][Bot #1][02/22 12:54:38 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 12288, Name: Mithril platebody (t), Amount: 1
[INFO][Bot #1][02/22 12:54:38 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 1051, Name: Santa hat, Amount: 17
[INFO][Bot #1][02/22 12:54:39 AM]: Price: 0
[INFO][Bot #1][02/22 12:54:39 AM]: currentItem: Item id: 6740, Name: Dragon axe, Amount: 11
[INFO][Bot #1][02/22 12:54:39 AM]: Price: 0

Why is this happening?

The item IDs are different to on rsbuddy (where I am getting the data from)

On rsbuddy Mithril platebody(t) is 12287 for example.

You should make use of the RSExchange class I wrote on the first page, passing the names of the items, to ensure that the correct IDs are used.

Edited by Explv

3 hours ago, Explv said:

The item IDs are different to on rsbuddy (where I am getting the data from)

On rsbuddy Mithril platebody(t) is 12287 for example.

You should make use of the RSExchange class I wrote on the first page, passing the names of the items, to ensure that the correct IDs are used.

What a silly goose I am. I was passing the ID's of the noted version. RSbuddy needs the IDs of the unnoted version. One can avoid using the other class you provided by simply finding the unnoted ID's using the getUnnotedID() method.
Thanks for your help :)
 

  • Author
22 minutes ago, Adept said:

What a silly goose I am. I was passing the ID's of the noted version. RSbuddy needs the IDs of the unnoted version. One can avoid using the other class you provided by simply finding the unnoted ID's using the getUnnotedID() method.
Thanks for your help :)
 

Ah noted id, that makes sense

  • 4 months later...
  • 2 months later...
  • 10 months later...

Hi @Explv, thanks for the snippet,

Map<String, ExchangeItem> exchangeItems = new RSExchange().getExchangeItems("Lobster",weapon(),ammo(),"Amulet of glory(6)","Ranging potion(4)");
rangingPotPrice = exchangeItems.get("Ranging potion(4)").getSellAverage()) 

This returns -1 sometimes and the correct answer othertimes, Its 50/50, am i doing something wrong

2 hours ago, Luke Reading said:

Hi @Explv, thanks for the snippet,


Map<String, ExchangeItem> exchangeItems = new RSExchange().getExchangeItems("Lobster",weapon(),ammo(),"Amulet of glory(6)","Ranging potion(4)");

rangingPotPrice = exchangeItems.get("Ranging potion(4)").getSellAverage()) 

This returns -1 sometimes and the correct answer othertimes, Its 50/50, am i doing something wrong

No, you aren’t doing anything wrong. Sometimes if the price has not updated, being that an item has not been purchased to record data, on OSBuddy in the past 15 minutes (don’t quote me on that exactly, but it is within a specific time frame), the last cached value gets reset to a non existent price (-1). You should multi-cach these values, and have a static backup to reference to. Or you could create a method to obtain the buy-sell prices and go off of those. 

 

EDIT:

Another thing you could do is do is try grabbing prices off of RuneScape’s GE database as a backup. Lots of things you can try!

 

Hope this helps!

 

Edited by ProjectPact

  • 1 year later...

Hmm, no matter what I do, what item, I always get -1 and 0 for all the values. Is there some reason it could be refusing the connection or something?

  • 1 month later...

 

:(

Has anyone found a new link?

Edited by camaro 09

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.