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.

What means

Featured Replies

import static BotHoe.GrandExchangeApi.*;

public class Test {
    public static void main(String[] args) {
        GrandExchangeApi exchangeApi = new GrandExchangeApi();
        GELookupResult lookupResult = exchangeApi.lookup(333);
        if(lookupResult != null)
            System.out.println("Item: " + lookupResult.name + " Price: " + lookupResult.price);
    }
}

if

GrandExchangeApi exchangeApi = new GrandExchangeApi(false);
private static GELookupResult parse(int itemId, String json) {
Pattern pattern = Pattern.compile("\"(?<key>[^\"]+)\":\"(?<value>[^\"]+)\"");
Matcher m = pattern.matcher(json);
Map<String, String> results = new HashMap<>();
while(m.find()) {
results.put(m.group("key"), m.group("value"));
}

int price = 0;
Matcher priceMatcher = Pattern.compile("\"price\":(?<price>\\d+)").matcher(json);
if (priceMatcher.find()) {
price = Integer.parseInt(priceMatcher.group("price"));
}

Can someone explain?

import static BotHoe.GrandExchangeApi.*;

public class Test {
    public static void main(String[] args) {
        GrandExchangeApi exchangeApi = new GrandExchangeApi();
        GELookupResult lookupResult = exchangeApi.lookup(333);
        if(lookupResult != null)
            System.out.println("Item: " + lookupResult.name + " Price: " + lookupResult.price);
    }
}

if

GrandExchangeApi exchangeApi = new GrandExchangeApi(false);

private static GELookupResult parse(int itemId, String json) {
Pattern pattern = Pattern.compile("\"(?<key>[^\"]+)\":\"(?<value>[^\"]+)\"");
Matcher m = pattern.matcher(json);
Map<String, String> results = new HashMap<>();
while(m.find()) {
results.put(m.group("key"), m.group("value"));
}
int price = 0;
Matcher priceMatcher = Pattern.compile("\"price\":(?<price>\\d+)").matcher(json);
if (priceMatcher.find()) {
price = Integer.parseInt(priceMatcher.group("price"));
}

Can someone explain?

 

 

1. Snippet that searches GE data for an object with id 333 and then prints name + price.

2. Part of a JSON parsing method, also for GE data retrieving.

  • Author

1. Snippet that searches GE data for an object with id 333 and then prints name + price.

2. Part of a JSON parsing method, also for GE data retrieving.

 

Thanks.

 

This?

public class GrandExchangeApi {
    private static final String API_LOCATION = "http://services.runescape.com/m=itemdb_oldschool" +
            "/api/catalogue/detail.json?item=%d";
    private static final long TEN_MINUTES = 600000;
    private final Map<Integer, GELookupResult> cache;
    private long startTime;

 

Thanks.

 

This?

public class GrandExchangeApi {
    private static final String API_LOCATION = "http://services.runescape.com/m=itemdb_oldschool" +
            "/api/catalogue/detail.json?item=%d";
    private static final long TEN_MINUTES = 600000;
    private final Map<Integer, GELookupResult> cache;
    private long startTime;

 

Ehm...

 

Variables.

 

API_LOCATION -> where the JSON data is retrieved from.

TEN_MINUTES ->  The amount (10 *  60 * 1000 = 600000) of milliseconds contained in 10 minutes.

cache -> A cache, map mapping object ID to GE data.

startTime -> System time when the object was initialized.

 

I'm just guessing from the context, I didn't write this :p

Thanks.

 

@@close

 

@@Decode

if you want to close your thread just report it the next time

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.