Skip 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. What d0zza said, or preferably make it a private int with a public getter method. Side note: I would recommend staying away from the task system people here use. It is overcomplicated, messy and counter-intuitive. Considering you are writing a chicken killer I don't know why you wouldn't just put this all in a single class. However if you want multiple classes, there are better ways to achieve it. Also you could remove a lot of duplicate code from your onPaint with a simple for loop.
  2. Check if the NPC you are fighting has 0 health, or no longer exists. If that is the case, increment your kill counter by 1 and look for a new NPC to fight.
  3. Hacks are for losers Git gud scrub
  4. You disgust me
  5. The timeRan variable should be local to the onPaint function. The Runescape area should be private, final, and start with a lowercase first letter, as per standard Java conventions. There should be a new line in between each method for better readability. The class should start with an uppercase first letter, as per standard Java conventions. Version number is 2, is this really version 2 though? info and logo in the @ScriptManifest attribute are severely lacking. You don't need to check that your player isn't moving before calling web walk. The indentation is completely fucked in some places. onExit method is unnecessary, and definitely misleading as it prints "Hello" to the logger when the script is in fact exiting. The methods and class should be final just in case someone in Lumbridge tries to override them. Do you really need to sleep for 100ms in between loops, when all you are doing is calling getWalking().webWalk()? Otherwise, good job!
  6. I think your way would still work, as long as you figure out what type of weapon they are using (ranged, mage or melee) and disregard the 4th combat option
  7. Still won't necessarily work for all melee weapons. Check this combat options page http://2007.runescape.wikia.com/wiki/Combat_Options "Melee weapons vary in their attack styles. Some have four options, with either a controlled option or an alternative aggressive attack with a different action, while others have only three options. Players intending to remain a pure with no Defence need to take care when using the third option (alternative aggressive), as switching weapons may result in controlled or defensive becoming selected, often only spotted when an unwanted Defence level is gained." So the 4th option might be Strength XP or it might be Attack, Strength and Defence
  8. It can vary for different weapons though I think
  9. An example of a post-test loop would be a do while loop. For example: do { // some stuff } while(some condition is true); // check this after The contents of this loop will execute at least once, because the condition is checked after the loop completes NOT before. This is different from a while loop where the condition is checked first: while (some condition is true) { // Check this first // some stuff } An example use of this is sanitizing input because you may want to get some input from the user THEN check it, and only exit the loop if some condition is matched. Consider this trivial example: Scanner scanner = new Scanner(System.in); String input; do { input = scanner.nextLine(); // Read a line of input } while (!input.equals("Hello")); // Only exit the loop if the input matches "Hello"
  10. I don't think there is a config for what skill you are / will gain xp in, only for which of the attack styles is selected.
  11. Have you verified that the .jar is not empty? You have to make sure you add the "compiled output" to your .jar in the artifact settings (by moving it to the left hand side) like in this image (sorry not OSBot specific because I'm on my phone)
  12. If you are rebuilding the same artifact it will work fine. Intellij states that there is an error, something along the lines of unable to delete .jar, but it still works. Just make sure you press refresh in the script selector on OSBot. Why are you dragging the .jar file to the scripts folder? In the artifact settings just set the path to the scripts folder. In what way do you think that it is not working? Have you tried doing something simple like, changing the script name in the script manifest attribute, rebuilding the artifact, then refreshing the script list in OSBot and seeing if the script name changes?
  13. The "No Randoms" option is not for dismissing randoms.
  14. I wrote something similar for someone before, you need to hover the widgets: //Credits to Explv //Main class private Skill currentAttStyle; private void setAttackStyle(final Skill attackStyle) { Event attStyleEvent = new AttackStyle(attackStyle.toString()); execute(attStyleEvent); if (attStyleEvent.hasFinished()) { currentAttStyle = attackStyle; } } //AttackStyle class public class AttackStyle extends Event { private final int attackStyleParent = 593; private final int[] attackStyleChildren = {3, 7, 11, 15}; private final String xpType; private int attackStyleToCheck = 0; public AttackStyle(final String xpType) { this.xpType = xpType; } @Override public int execute() throws InterruptedException { if (getTabs().getOpen() != Tab.ATTACK) { getTabs().open(Tab.ATTACK); return 0; } RS2Widget attackStyleWidget = getWidgets().get(attackStyleParent, attackStyleChildren[attackStyleToCheck]); if (attackStyleWidget == null) { setFailed(); return 0; } if (!attackStyleWidget.hover()) { return 0; } sleep(random(500, 600)); if (getWidgets().singleFilter(attackStyleParent, widget -> widget.getMessage().matches(".*\\(" + xpType + " XP\\)$")) == null) { attackStyleToCheck++; if (attackStyleToCheck >= attackStyleChildren.length) { setFailed(); } return 0; } Rectangle widgetBounds = attackStyleWidget.getBounds(); double colorX = widgetBounds.getMinX() + 5; double colorY = widgetBounds.getMinY() + 5; if (getColorPicker().colorAt((int) colorX, (int) colorY).getRed() > 100) { log("Already selected"); setFinished(); return 0; } if (attackStyleWidget.interact()) { setFinished(); } return 0; } }
  15. Explv replied to phony's topic in Scripting Help
    Thanks pal
  16. Explv replied to phony's topic in Scripting Help
    https://osbot.org/api/org/osbot/rs07/api/map/constants/Banks.html
  17. Seems like a duplicate of this question: https://osbot.org/forum/topic/121176-osbot-dropping-bot-like/?do=findComment&comment=1376627
  18. Such as? I just tested it, and it works fine
  19. Only if you want to get the script parameters that the user has set. You can get the script parameters using getParameters() The script parameter format will be set by the script writer. It will likely be on the script thread, if not you will have to ask them. It may be the case the script has no parameters at all, in which case you can just set the script parameters to "none". You cannot set breaks using CLI. Not sure exactly sure what you mean by automatically close down a bot from the command line, do you mean when the script exits, or after x amount of time?
  20. Explv replied to Void's topic in Scripting Help
    Just sleep until either the inventory does not contain flax, or the dialog is pending continue: return !getInventory().contains("Flax") || getDialogue().isPendingContinuation();
  21. You should read some tutorials, there are loads on this website, and learn basic Java if you have not done that yet.
  22. Not really sure what you mean. If you want to do something when the script exits, override the onExit method in the Script class: @Override public void onExit() { }
  23. https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)
  24. If an item is stackable, it's noted id will be -1. Here is a test example: // Fire rune (stackable) log("Fire rune noted id: " + ItemDefinition.forId(554).getNotedId()); // Cannonball (stackable) log("Cannonball noted id: " + ItemDefinition.forId(2).getNotedId()); // Yew logs (not stackable) log("Yew logs noted id: " + ItemDefinition.forId(1515).getNotedId()); Output: [INFO][Bot #1][05/03 10:17:00 PM]: Fire rune noted id: -1 [INFO][Bot #1][05/03 10:17:00 PM]: Cannonball noted id: -1 [INFO][Bot #1][05/03 10:17:00 PM]: Yew logs noted id: 1516 So to check if a ground item is stackable: groundItem.getDefinition().getNotedId() == -1
  25. Have you tried this to check if it is noted: groundItem.getDefinition().isNoted()

Account

Navigation

Search

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.