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. In this case I would probably just make your method throw an InterruptedException.
  2. getBank().open() Throws an InterruptedException. You either need to catch the exception or make your method throw an InterruptedException as well
  3. Firstly the answers to your questions: If i make a GUI, should it be in a separate class? It's up to you, it would be cleaner if it was in a separate class. Am I using ConditionalSleep correctly? Yes and no, the ConditionalSleep itself is fine, but you are calling it in the wrong place. You should only call the ConditionalSleep after you have checked the tree is not null and also after you have checked the interaction with the tree was successful. Otherwise your script will sleep when it shouldn't. Would using States make this script better? No, personally I don't think anyone should use States, because you are separating the condition from the action, which just makes it harder to read. I think that when your script becomes more complex, you should separate it out into classes and methods accordingly. If I have a complex script, should I put all my functions in a separate module? I don't understand what you mean by this question, consider reading some basic OOP tutorials. Other issues I can see looking at your code: Remove the onStart() and onEnd() methods considering you aren't doing anything useful in them Declare the Area lumbridgeTrees as a private global variable so that you aren't redefining it every time onLoop is called After you do the check for if the inventory is full, I would probably make the next if statement an else if You don't need to web walk to a random position in the Area lumbridgeTrees, just call webWalk(lumbridgeTrees) You probably want to check if the player should chop a new tree (your ableToWork()) method before finding a new Tree, otherwise you are just constantly looking for the closest tree when you don't even want to chop it. You should only perform the conditional sleep after the .interact("Chop down") method has returned true. You should return boolean instead of Boolean from the method ableToWork() You should follow Java naming conventions, (the name of your class should start with an uppercase letter). Also, although it doesn't particularly matter in this context, I would give your Script class a better name than "Main", perhaps "Woodchopper" would be more appropriate.
  4. Just do something like: if (myPlayer().getInteracting() == null) { NPC cow = getNpcs().singleFilter(getNpcs().getAll(), new NameFilter<>("Cow"), Character::isAttackable); if (cow != null && cow.interact("Attack")) { new ConditionalSleep(5000) { @ Override public boolean condition() throws InterruptedException { return myPlayer().isInteracting(cow) || !cow.isAttackable(); } }.sleep(); } }
  5. I don't use Eclipse but I believe that you need to set the compliance level to 1.8 under the compiler section in properties
  6. Ok, I didn't actually test the client closing on linux, I just wrote it and prayed. I'll fix it asap.
  7. What distribution?
  8. Are you using Linux?
  9. There is a bug I need to fix for usernames with a space in them, for now use "Hi G00gle" as your username (with the quotes). I will fix this in the next version
  10. Check the log (right click the configuration and select view log) if it says the script stopped then it's an issue with your script. The logs will remain until you start the configuration again so you can check them
  11. You don't need to make a duplicate thread. Just edit your first one
  12. Issue fixed, user was using openJDK, installed oracle JDK instead
  13. Try Image image = ImageIO.read(URL);
  14. Did you even define the method getImage?
  15. Java: Python 3:
  16. Just an update on this, I have successfully written a method to check if an account is banned, it takes 1 or 2 seconds to check an account, and does so by logging into the RuneScape website and checking the account settings page. I will integrate this into the GUI tonight or tomorrow
  17. I will see what I can do I don't understand what you are trying to ask
  18. I believe that only works for free scripts. The best way to get the SDN ID is to run the script, the ID will be in the log
  19. Just pushed a fix, it will be available when the SDN is next updated Will take a look at these issues as soon as possible, thanks Haven't had time to address this yet, will look at it ASAP When I have ironed out all the bugs, and added some more features then I will likely request it to be premium
  20. UPDATED 2017-01-11 - Now loads all scripts found in a single .jar Thanks to @PineappleSausage for the contribution
  21. You can already view the logs, I haven't added a button yet but if you right click a configuration and select view log it will display.Thanks, I'll take a look at your git request tomorrow after work I will also add some build instructions to the readme
  22. If you just want to execute a script after another has stopped you can use my manager: http://osbot.org/forum/topic/100554-explvs-osbot-manager/ But if you need something more complex, you could try initialising a script like so (I have not tested this): // Initialise the script Script someOtherScript = new SomeScript(); someOtherScript.exchangeContext(getBot()); // Call onStart someOtherScript.onStart(); // In onLoop of your wrapper script call return someOtherScript.onLoop(); You would probably also need to override the stop() method of the script you are running, so that it doesn't stop the ScriptExecutor and does something else instead.
  23. Easiest solution is just to sleep until either your player can no longer combine items, or (if applicable, your character has leveled up): new ConditionalSleep(60_000) { @ Override public boolean condition() { return !canCombine() || getDialogues().isPendingContinuation(); } }.sleep(); Where canCombine() would be something like: public boolean canCombine() { return getInventory().contains("Item 1") && getInventory().contains("Item 2"); }
  24. Issues in the order that I see them: No need to store starting level or starting experience, you can use the ExperienceTracker in the API to calculate experience and levels gained No need to store time elapsed as a global variable as you will be recalculating this every time you paint anyway You don't need to initialise a boolean value to false, it's false by default It would be cleaner to use an Enum to store the data for the different trees, you can store the area in which you can find the tree, the level required etc. Instead of downloading the paint image every time, you can just store the image locally in the .jar You don't need to initialise a new Color for black and white, they already exist Color.BLACK and Color.WHITE (You may have got this from my GUI tutorial, which I should really update) But you don't need to store a fixed size for the GUI, you should let it calculate the size itself based on its contents You can centre the GUI using setLocationRelativeTo(null) This is a matter of preference but I think using States is pretty pointless, I think it's easier to read and understand if the conditions are in the same place as the code being executed based on those conditions Instead of calling the same method treeCut with different parameters based on the player's wc level, it would make more sense to just have a global variable with the current tree name and area, change those variables based on the player's wc level, and then just have a single call to treeCut with those variables. Again this would be simpler if you had a Tree Enum Instead of calling sleep after each case statement, it would make more sense just to break, and then return the sleep value at the end of the onLoop method, which you are already doing, so basically you are sleeping twice. In your tree cut method you check if your player is in the tree area, and if not you walk there, it would make sense to do this before the treeCut method, and leave the treeCut method to do what it's name implies, cut the trees. You aren't making use of ConditionalSleeps in your code, for example after you interact with the tree, you just do a random sleep, this can result in spam clicking the tree. What you should do instead, is check the boolean return value of the interact method, if it is true, then do a ConditionalSleep with a timeout e.g. 5 seconds, with the exit condition that the player is animating (chopping the tree) You call camera.toEntity(tree), which I believe is redundant, because the interact method will already move the camera to face the tree if it is not visible Consider making use of classes, for example moving your GUI to a separate class to make your code more readable and maintainable Hope that helps
  25. Explv replied to Explv's topic in Spam/Off Topic
    Quality over quantity

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.