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.

Disposition

Members
  • Joined

  • Last visited

Everything posted by Disposition

  1. Make sure that when you declare the list you instantiate it, i.e. public ArrayList<String> StackableLootList = new ArrayList<>();
  2. Yeah I know it's not the most original idea, but I only saw one finished script when I looked it up yesterday so I figured that I may as well take a crack at it.
  3. Hi everyone, So this is my first crack at making a script for OSBot. It's a simple kebab buyer that buys kebabs from Karim in Al-Kharid and banks them. It's not particularly profitable but it's a good way to get some starting cash so that you can move on to other money making methods. FEATURES Nice paint Buys kebabs TO DO More antipattern/antiban Walk to Al-Kharid from anywhere (web walking) Walk to GE and sell after certain amount Any other ideas or feedback, I'd appreciate it. If anyone wants to test let me know.
  4. Thanks for the feedback! I know the caching is pretty rudimentary, but as far as I know GE prices only update once a day so it's not really a significant problem. Hadn't thought of making the results mutable though, the only problem I can see with doing that is in situations when you want to store the result as it was when you looked it up (maybe to monitor price changes).
  5. With this you can lookup: Price Icon (32x32 normal and 96x96 large) Description Name Others I've also included some caching to minimize API lookups but you can disable this if you want. Usage: Create a new instance of the API: GrandExchangeApi api = new GrandExchangeApi(); Look up an item: GELookupResult result = api.lookup(itemId); Get data about the item: int price = result.price; String iconUrl = result.smallIconUrl; String description = result.description; //etc Snippet: import java.io.IOException; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Utility class for access to the Grand Exchange API. */ public class GrandExchangeApi { /** * The URL of the API endpoint. */ private static final String API_LOCATION = "http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=%d"; /** * The cache in which items that have already been looked up are stored. */ private final Map<Integer, GELookupResult> cache; /** * Creates a new Grand Exchange API instance, with caching enabled. */ public GrandExchangeApi() { this(true); } /** * Creates a new Grand Exchange API instance. * @param cache Whether to enable caching of results. */ public GrandExchangeApi(boolean cache) { if(cache) { this.cache = new HashMap<>(); } else { this.cache = null; } } /** * If caching is enabled, clears the cache so that new results are fetched on lookup. */ public void flushCache() { if(cache != null) { cache.clear(); } } /** * Looks up an item using the Grand Exchange API. This method blocks while waiting for the API result. * @param itemId the id to look up. * @return the result returned by the api. May be null if an error has occurred. */ public GELookupResult lookup(int itemId) { if(cache != null) { GELookupResult result = cache.get(itemId); if(result != null) { return result; } } String json; try { URL url = new URL(String.format(API_LOCATION, itemId)); Scanner scan = new Scanner(url.openStream()).useDelimiter("\\A"); json = scan.next(); scan.close(); } catch(IOException e) { return null; } GELookupResult result = parse(itemId, json); if(cache != null) { cache.put(itemId, result); } return result; } /** * Parses a GELookupResult from the JSON returned by the API. * @param itemId The item ID. * @param json The JSON returned by the server. * @return The serialized result. */ 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")); } return new GELookupResult( results.get("icon"), results.get("icon_large"), results.get("type"), results.get("typeIcon"), results.get("name"), itemId, price ); } /** * A class representing a result from an API lookup. */ public static final class GELookupResult { public final String smallIconUrl, largeIconUrl, type, typeIcon, name; public final int id, price; private GELookupResult(String smallIconUrl, String largeIconUrl, String type, String typeIcon, String name, int id, int price) { this.smallIconUrl = smallIconUrl; this.largeIconUrl = largeIconUrl; this.type = type; this.typeIcon = typeIcon; this.name = name; this.id = id; this.price = price; } } }

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.