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. Explv replied to Explv's topic in Tutorials
    Sure
  2. No, if the script has CLI support you can add the parameters you want to use when you add the Script. Otherwise, leave it blank, and it will start the script as normal Could you show me the error? I will take a look tonight
  3. Explv replied to Explv's topic in Tutorials
    Yep, I will add a section on Events
  4. OP is asking how to use a do while loop to keep reading input from the user, not how to use the MVC pattern with Swing? Seems silly to overcomplicate it with a GUI when OP doesn't even understand loops yet
  5. You need a do while loop along the lines of "do, get the user's input and change the direction of the robot if the input is valid, while the user's input is not the exit program character" The exit character might be something like ESC
  6. @Page27 If you mean collect mouse data while you play legit, then you could do something like: import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.Point; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; @ScriptManifest(name = "Mouse Tracker", author = "Explv", info = "", version = 0.1, logo = "") public class MouseExample extends Script { private final List<Point> mouseClickPoints = new ArrayList<>(); private final List<Point> mouseMovedPoints = new ArrayList<>(); @Override public void onStart() { bot.getCanvas().addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { super.mouseClicked(e); mouseClickPoints.add(e.getPoint()); } }); bot.getCanvas().addMouseMotionListener(new MouseAdapter() { @Override public void mouseMoved(MouseEvent e) { super.mouseMoved(e); mouseMovedPoints.add(e.getPoint()); } }); } @Override public int onLoop() throws InterruptedException { return 1000; } @Override public void onExit() { // Output the mouse data } }
  7. Perhaps the Mouse class? And ClientMouseEventHandler
  8. Explv replied to Explv's topic in Tutorials
    The thing is, if you knew basic Java, like I state as the prerequisite to this tutorial, you would know that in order to use the methods contained in NPC, GroundItem etc. that are not found in the Entity superclass, then you would use the relevant subclass name when storing the instance. I never mention in this tutorial that you should exclusively use Entity and not the subclass name, I am merely showing the relationship between the different types.
  9. Explv replied to Explv's topic in Tutorials
    And why would that be?
  10. Explv replied to Explv's topic in Tutorials
    I'll add some more today after work
  11. Explv replied to Explv's topic in Tutorials
    Let me know if I have missed anything
  12. Explv replied to Explv's topic in Tutorials
    Gracias amigo
  13. Explv replied to Explv's topic in Tutorials
    In this case it is primarily for readability purposes, and a habit of mine from working on larger projects with other people.
  14. Multiline spoilers seem to be broken:
  15. Explv's Scripting 101 Prerequisite: basic knowledge of Java 1. Setting up the Java Development Kit and an Integrated Development Environment (IDE) 2. The Script Skeleton 3. Building the script 4. The Script class continued 5. The MethodProvider class, accessing the Inventory, Bank, Player, etc. instances 6. Positions, areas and moving the player 7. Entities (Players, RS2Objects, NPCs and GroundItems) 8. Interactions 9. Sleeping 10. Items and ItemContainers (Inventory, Bank, Equipment, Store, ...) 11. Filtering 12. Widgets 13. Configs 14. Adding a paint 15. Putting it all together, an example script (Smelting iron bars in Al-kharid) 16. Adding a GUI
  16. Explv replied to Saiyan's topic in Spam/Off Topic
    http://www.userbenchmark.com/UserRun/2713886
  17. I could probably add something to ssh into a VPS and run the commands, i'll see what I can do when I have some free time
  18. Agreed, this is over complicated. Either of these options would suffice: Where the message is: String lootMessage = "<col=ef1020>Valuable drop: Onyx (3,038,047 coins)</col>"; Matcher m = Pattern.compile(": (.+) \\(").matcher(lootMessage); if (m.find()) { String loot = m.group(1); } or String loot = lootMessage.substring(lootMessage.indexOf(": ") + 2, lootMessage.lastIndexOf(" ("));
  19. Explv replied to Void's topic in Archive
    I have updated the post where I assume you got this snippet from: http://osbot.org/forum/topic/88389-mining-rocks-with-ore-no-ids/ You can just put the Rock enum in it's own file called Rock.java The usage is also on the thread.
  20. You probably declared your JComboBox like: JComboBox comboBox = new JComboBox(); When it should be: JComboBox<Type> comboBox = new JComboBox<>(); Where "Type" is whatever type script.getTrees() returns
  21. Are you using the latest version? 5.2?
  22. 1. Generally you should try and avoid the use of static unless you are absolutely sure it is correct to use it, and makes sense to use it. A static method belongs to the class and not any instance of the class. It is commonly used for utility methods, another example of it's use would be in the Singleton Pattern. You will find a lot of amateur programmers abusing the static keyword due to their lack of understanding of OOP. 2. You are probably getting this warning because you are using raw types, read a tutorial on Java generics 3. An Enum is a class, it can still have methods etc. It is generally used when you want to specify a fixed list of constants. For example you may have a Tree Enum that specifies a fixed list of Trees someone can choose from in your script. TL;DR Follow some more tutorials and learn some more Java
  23. Optional<NPC> npcOpt = getNpcs().getAll() .stream() .filter(n -> n.getName().equals("NPC Name") && n.getPosition().distance(myPosition()) > 2) .min((n1, n2) -> Integer.compare(n1.getPosition().distance(myPosition()), ​n2.getPosition().distance(myPosition()))); Explanation: Construct a Stream<NPC> of all the NPCs around the Player Filter the Stream<NPC> so that only the NPCs who's name matches "NPC Name" and is more than two tiles away from the player remain Apply the min function to the Stream<NPC> using a custom comparator that compares distances from the player (essentially returns the closest NPC to the player) Returns an Optional<NPC> With the return value of Optional<NPC>, instead of null checking you do something like: npcOpt.ifPresent(npc -> { }); For more information on the Optional class see https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html For more information on streams see http://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html and https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html
  24. getBank().depositAllExcept(item -> item.getName().endsWith(" axe"));
  25. In this case a JCheckBox would make more sense, however, if you want to use a JComboBox, this works: JComboBox<String> optionSelector = new JComboBox<>(new String[]{ "Yes", "No" }); To check if "Yes" is selected: boolean yesSelected = optionSelector.getSelectedItem().toString().equals("Yes");

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.