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.

Explv

Scripter II
  • Joined

  • Last visited

Everything posted by Explv

  1. So it was you that dun a goof! Changing the .jar name doesn't change the script name. The script name is set inside the code, and you can't have two scripts with the same name. Just move the old version to a different folder.
  2. Either you dun goofed Or he dun goofed
  3. Yes, you will be notified of an update in the app though.
  4. Explv replied to Explv's topic in Others
    Script is fixed on the SDN.
  5. Simplest way would be: List<NPC> warriors = getNpcs().filter(new NameFilter<>("Al-Kharid warrior"));
  6. Explv replied to Explv's topic in Others
    I know, I did a goof I already pushed a fix. It should hopefully be resolved tonight or tomorrow. The script only works currently if started from the command line.
  7. Only way I can think of right now is to try hopping to a members world and seeing if you can.
  8. Explv replied to Explv's topic in Snippets
    1. Not necessarily true, you could call the match function yourself with an invalid widget outside of the OSBot methods 2. I am using a foreach loop, I don't need to check if the array is empty 3. I personally think that this convention is purely personal preference and ancient history. I find code much more legible if I have early return conditions. If your code has many many return statements in a single function, then probably it is not as object oriented as it should be, in this case I do not think it applies. 4. If you look at how my loops are structured I only loop the widget's actions once, and the match actions are stored in a variable.
  9. Consider having a read of the Java Random.nextGaussian method: https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextGaussian--
  10. Explv replied to Explv's topic in Others
    Done. Will be available when the SDN is next updated. UPDATES: These will be available when the SDN is updated: Added CLI parameters Alphabetically sorted location drop down list Display error message on screen when web walking fails
  11. Explv replied to Explv's topic in Others
    Done, it will be alphabetically sorted when the SDN is next updated.
  12. Explv replied to Explv's topic in Snippets
    Updated the code here, previously could cause NPE if RS2Widget.getInteractActions() contains a null value. Changed if (widgetAction.equals(matchAction)) To if (matchAction.equals(widgetAction)) Thanks for the bug report @The Undefeated
  13. It's my bad really, that but has been around for quite a while, I have been taking a break from working on this script. Got a lot of shit to fix!
  14. Explv replied to progamerz's topic in Resolved
    You could have Googled that and found a million examples, it's an extremely common question. Either way you should have been able to figure it out, especially if you're scripter Juan. Idk how you could not understand that question, it's a fookin for loop bro. Time to start expanding your brain fam. Although the for loop method is preferred, it can also be done recursively: int Factorial(int i) { if (i <= 1) return 1; return i * Factorial(i - 1); }
  15. I have a bunch of things I need to update and fix, will do it as soon as I can
  16. ???? Look at the API bro https://osbot.org/api/org/osbot/rs07/api/Inventory.html#dropAllExcept-org.osbot.rs07.api.filter.Filter...- It can take more than one filter as a parameter, or you can just add an OR condition to your existing filter. getInventory().dropAllExcept(item -> item.getName().contains("fishing") || item.getName().equals("Blah")); getInventory().dropAllExcept(item -> item.getName().contains("fishing"), new NameFilter<>("Blah"));
  17. 1. Scripts are written in Java 2. Whatever you want 3. Learn how to use Google 4. Learn how to program 5. Mac works fine 6. See no. 3
  18. Relax guys Here's a picture of a dog wearing a hat
  19. Did you try wrapping it in tin foil?
  20. No Edit: btw this is the scripting help section, it is for questions regarding the process of developing scripts, not for finding people to write you one. If you want someone to fix it, expect to pay, and post in the appropriate section
  21. Explv replied to liverare's topic in Snippets
    Ok well, if you don't want to round then you can just do Math.floor(doubleValue * 100) / 100 to get the value to 2dp To achieve your super weird format you can use the Java class "DecimalFormat" with the format ".0#" # is an optional value (if it is 0 it won't be displayed), 0 is a digit public static String formatValue(final long value) { String suffix; double convertedValue; if (value >= 1_000_000_000) { convertedValue = ((double) value / 1_000_000_000); suffix = "b"; } else if (value >= 1_000_000) { convertedValue = ((double) value / 1_000_000); suffix = "m"; } else if (value >= 1000) { convertedValue = ((double) value / 1000); suffix = "k"; } else { return String.valueOf(value); } convertedValue = Math.floor(convertedValue * 100) / 100; return new DecimalFormat(".0#").format(convertedValue) + suffix; } Test cases: assert formatValue(559546000000L).equals("559.54b"); assert formatValue(19546000000L).equals("19.54b"); assert formatValue(1954600000L).equals("1.95b"); assert formatValue(155400000L).equals("155.4m"); assert formatValue(70000000L).equals("70.0m"); assert formatValue(5400000L).equals("5.4m"); assert formatValue(450000L).equals("450.0k"); assert formatValue(12000L).equals("12.0k"); assert formatValue(8000L).equals("8.0k"); assert formatValue(600L).equals("600"); assert formatValue(50L).equals("50"); assert formatValue(2L).equals("2");
  22. Explv replied to liverare's topic in Snippets
    Simplest way you wieners: This will also ensure whole numbers are not printed with .0 at the end: public static String formatValue(final long value) { String suffix = ""; double convertedValue; if (value >= 1_000_000_000) { convertedValue = ((double) value / 1_000_000_000); suffix = "b"; } else if (value >= 1_000_000) { convertedValue = ((double) value / 1_000_000); suffix = "m"; } else if (value >= 1000) { convertedValue = ((double) value / 1000); suffix = "k"; } else { convertedValue = value; } if (convertedValue % 1 == 0) { return String.format("%d%s", (long) convertedValue, suffix); } return String.format("%.2f%s", convertedValue, suffix); } Test cases: assert formatValue(559546000000L).equals("559.55b"); assert formatValue(19546000000L).equals("19.55b"); assert formatValue(1954600000L).equals("1.95b"); assert formatValue(155400000L).equals("155.40m"); assert formatValue(70000000L).equals("70m"); assert formatValue(5400000L).equals("5.40m"); assert formatValue(450000L).equals("450k"); assert formatValue(12000L).equals("12k"); assert formatValue(8000L).equals("8k"); assert formatValue(600L).equals("600"); assert formatValue(50L).equals("50"); assert formatValue(2L).equals("2");
  23. If there aren't any then just leave it blank, it should auto fill it to "none".
  24. Great tutorial, I learned a lot, thanks!

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.