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 MassRS's topic in Scripting Help
    You should probably learn what that means..
  2. The simplest way to open a bank without spam clicking is using the following method: public void openBank() throws InterruptedException{ getBank().open(); // Open the bank new ConditionalSleep(5000) { // Sleep until the bank is open, or for 5 seconds @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } The same logic can be applied to many different tasks in scripts. For example, if you wanted to chop down a tree, to prevent spam clicking you could do something like: @Override public int onLoop throws InterruptedException { if(!myPlayer().isAnimating()){ chopDownTree(); // Chop down a tree if we're not animating } return random(200, 300); } private void chopDownTree(){ RS2Object tree = S.getObjects().closest("Tree"); if(tree != null){ tree.interact("Chop down"); // Chop down the tree new ConditionalSleep(5000) { // Sleep until the player is animating, or for 5 seconds @Override public boolean condition() throws InterruptedException { return S.myPlayer().isAnimating(); } }.sleep(); } }
  3. Explv replied to Explv's topic in Others
    Yeah I know, I have pushed a solution to the SDN, just waiting for the SDN to be updated. Problem is the bugs aren't reproducible on my local version. They only occur on the SDN :P
  4. There are plenty of Java tutorials on the internet. Once you are familiar with Java read the scripting tutorials in the Scripting help section, and check out the API which can be found in the navigation bar above.
  5. Explv replied to Explv's topic in Others
    The SDN hasn't been updated yet....
  6. It will most likely be based on the widgets in the spell tab. The spells will have different widget values when they are highlighted (can cast) and when they are not. Therefore using this method you need to change to the spell tab to check it. The only other alternative is to check your supplies in the inventory & equipment.
  7. Check if your inventory contains the runes... private boolean canTeleportToVarrock(){ return getInventory().contains("Fire rune") && getInventory().contains("Law rune") && getInventory().getAmount("Air rune") >= 3; }
  8. Explv replied to Explv's topic in Others
    I have been busy at work... I will take a look at it this weekend. Please be patient Edit: Issue should be resolved. The script should work once the SDN is updated.
  9. Explv replied to Explv's topic in Others
  10. You missed out your username from the config path. You put @c:\Users\Desktop\... rather than @C:\Users\Cody\Desktop\... Also in the .pro file where you have put package.Core that should be replaced with your package name. If your main script file Core is not in a package, just put -keep public class Core
  11. Explv replied to Explv's topic in Others
    Issue should be fixed shortly
  12. There is a new walking method too you know: walking.walk(position); And its probably an issue with your Script, not the OSBot API
  13. Nope, studied CS, currently working as a Software Engineer.
  14. Software Engineer
  15. Or you can just do private final Area LUMBRIDGE_BANK = new Area(new Position(3205, 3208, 2), new Position(3216, 3229, 2));
  16. This code wont make any difference. Considering his walking code will be inside the onLoop method, the same functionality will occur. The issue lies somewhere else, probably with the walker stopping outside the area due to its minThreshold setting.
  17. Missed a line out: -keepattributes *Annotation* Which is essential, because you need to keep the @ScriptManifest annotation. I have edited the config.
  18. Maybe not for you, but some people asked me to make it, and some people don't know how to do it
  19. As some people do not know how to do this, and it is useful to prevent people stealing your code, here is how to obfuscate (https://en.wikipedia.org/wiki/Obfuscation) using ProGuard. If you don't know what Obfuscation looks like, here is an example of one of my classes, post obfuscation: 1. Download and extract proguard http://sourceforge.net/projects/proguard/files/ 2. Create a folder anywhere called "proguard_configs", this is where you will store your configuration files to be used with ProGuard. 3. In the proguard_configs folder, create a new empty proguard config file (.pro) in notepad. 4. Define your configuration, here is the configuration I use for my scripts: -injars C:\Users\Username\OSBot\Scripts\script.jar -outjars C:\Users\Username\Obfuscated\script_obf.jar -libraryjars C:\Users\USername\Downloads\OSBot 2.4.29.jar -libraryjars C:\Program Files\Java\jre1.8.0_66\lib\rt.jar -keepattributes *Annotation* -keep public class package.Main -injars is file path to the script .jar to be obfuscated -outjars is the file path to the obfuscated script .jar -libraryjars are the OSBot.jar and the Java runtime rt.jar -keepattributes *Annotation* ensures that we keep the @ScriptManifest annotation Finally we specifiy that we want to keep the main Script class, as we need this as the entry point to our script. You should replace "package.Main" with the package that your script is in, and the name of your main script file 5. Finally run the following command in cmd / terminal, replacing path_to_proguard with the path to proguard.jar, which is found in the proguard\lib folder, and path_to_config with the path to the .pro file you previously made: java -jar path_to_proguard.jar @path_to_config.pro 6. Note if you get warnings about missing classes, that are not classes you have defined, add to you config the line, replacing javafx with the package name: -dontwarn javafx.**
  20. You should place the image inside of a folder called "resources". This folder should be placed within src You then load the image using: private void initComponents() { Image image = getImage("title.png"); if(image != null) label1.setIcon(new ImageIcon(image)); } private Image getImage(String imageName){ try{ return ImageIO.read(TutorialIsland.class.getResourceAsStream("/resources/" + imageName)); } catch(IOException e){ } return null; }
  21. I have rewritten it slightly. I put the onLoop code inside if(!myPlayer().isAnimating()) so that it will not click the Tea stall if it is already thieving. Then I added a ConditionalSleep after the interaction, which stops sleeping when the player has begun animating. (untested) import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "You", info = "My first script", name = "Tea thiever", version = 1.0, logo = "") public class TeaStealer extends Script { private enum State { STEAL, DROP } @Override public int onLoop() throws InterruptedException { if(!myPlayer().isAnimating()) { switch (getState()) { case STEAL: steal(); break; case DROP: drop(); break; } } return random(200, 300); } private State getState() { if(getInventory().isFull()) return State.DROP; return State.STEAL; } private void steal(){ Entity stall = getObjects().closest("Tea stall"); if (stall != null) { stall.interact("Steal-from"); new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } private void drop(){ getInventory().dropAll(); } }
  22. Works fine for me when I run it (not on OSBot): The only thing I had to remove was: label1.setIcon(new ImageIcon(getClass().getResource("/title.png")); because I don't have the image obviously. Perhaps you are getting an NPE because one of the image locations is wrong
  23. import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.utility.ConditionalSleep; public class DoorHelper { private final Script S; public DoorHelper(final Script S){ this.S = S; } public RS2Object getDoor(Area doorArea){ //noinspection unchecked return S.getObjects().closest(obj -> obj.getName().equals("Door") && doorArea.contains(obj)); } public boolean doorIsClosed(RS2Object door){ return door.hasAction("Open"); } public void openDoor(Area doorArea){ RS2Object door = getDoor(doorArea); if(door != null && doorIsClosed(door)){ door.interact("Open"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return !doorIsClosed(getDoor(doorArea)); } }.sleep(); } } }

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.