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. You need to run a ConditionalSleep until the player is chopping the tree. Read section 9 of my tutorial: https://osbot.org/forum/topic/115124-explvs-scripting-101/
  2. Game of thrones?!?!!!!!?!! Westworld Stranger things Better call Saul Taboo Prison break is good for first few seasons Lost
  3. @reiska You cannot make API calls like myPosition() before onStart() is called. It doesn't make any sense for that to be there anyway because you'll only get your position once. You should do it onLoop after you walk. You also have a pair of {} after your call to walk() that shouldn't be there.
  4. This is why "States" suck: What looks cleaner, this: enum State { CHOP, WALK_TO_BANK, WALK_TO_TREES, BANK } @Override public int onLoop() throws InterruptedException { switch(getState()) { case CHOP: chop(); break; case WALK_TO_BANK: getWalking().... break; case WALK_TO_TREES: getWalking().... break; case BANK: bank(); break; } return 0; } private State getState() { if (whatever) { return State.BANK; } else if (whatever) { return State.WALK_TO_BANK; } else if (whatever) { return State.WALK_TO_TREES; } else { return State.CHOP; } } Or this? : @Override public int onLoop() throws InterruptedException { if (whatever) { chop(); } else if (whatever) { getWalking().... } else if (whatever) { bank(); } else { getWalking().... } } Unless you are completely blind, I think you would agree the second is far more readable and much less code. Instead of having to look in a different method for the conditions, they are right there next to the code I am executing when they're satisfied. I don't need to maintain a redundant enum either. People will argue that using "States" are cleaner, however this is probably because they are not making use of the DRY principle, not making effective use of methods etc. and without "States" they would just throw all of their code into onLoop. As for "Tasks" or "Nodes", they have the exact same issues as "States" and more. People will argue they are cleaner because now each of their actions is in a nice self contained class, and the condition is in there too. However using this pattern you have now even less of an overview of the script as you did with states, and it's even harder to debug. Consider this: List<Node> someRandomAssNodes = new ArrayList<>(); @Override public int onLoop() throws InterruptedException { for (Node node : someRandomAssNodes) { if (node.validate()) { node.execute(); } } return 0; } The problem with this is that now in order to figure out how this script will execute I need to go into each of those Node classes, in the same order that you add them to the List and look at each of the validate methods and try and figure out how they all fit together: I mean, that pattern is pretty bonkers don't you think? Instead of having: WalkToBankNode ChopNode BankNode WalkToTreesNode DoSomeOtherShitIDKNode Why not just just write something simple, and easy to understand like my previous example. IF your script gets massively complex, then you should be making use of OOP principles to simplify it. You still don't need to use a weird 'Node' or 'Task' pattern, you can have a generic banking class without needing to add a validate method inside of it, and you can have a mining class without having a validate method in there either. Sorry if the some of the syntax is off, or I rambled.
  5. I personally use neither. "States" are a complete waste of space and makes your code far less readable. And if by tasks you mean classes with a validate and execute method, those are just as shitty as states, except instead of having all your conditions in one weird method they're now split up in different classes. You shouldn't really follow any of the weird design patterns people post on here Structure your script how you would any other Java program. Use design patterns appropriately and don't be a ?, create your own design patterns if an existing one doesn't work
  6. I have also pushed a change for fire runecrafting, once the SDN is updated you will have the option to use a ring of dueling for faster fire rune runs.
  7. This is now fixed on the SDN
  8. Yep I can see the bug, will push a fix tonight. Thanks. Thanks, i'll keep it in mind as a possible future enhancement I think some users are still having issues with GUI saving / loading. I will be investigating that tomorrow, once fixed I will then add the ability to launch from the command line.
  9. Pushed a fix, will be available when the SDN is next updated.
  10. You're thinking about it completely wrong. It doesn't make sense for getLastRequestingPlayer to be null unless no one has traded you. What you should do is have a global boolean variable, let's call it shouldTrade. You initialise shouldTrade to false. Then you add a message listener using getBot().addMessageListener(MessageListener listener) or override the onMessage(Message message) method in your script class. Inside the onMessage method you then check if the message is of type RECEIVED_TRADE. If it is of that type set shouldTrade to true. In onLoop you check if shouldTrade is true, if it is then you can begin trading. Once the trade is complete, set shouldTrade to false. There are other ways to do it, but that's probably the simplest
  11. Explv replied to Explv's topic in Snippets
  12. Yep that's the issue, I will take a look at fixing it this weekend. Thanks
  13. Try going to pollnivneach with an empty inventory. Will try to add a fix later Will push a fix tonight
  14. Explv replied to Explv's topic in Snippets
    You could try checking getBot().isLoaded() I will try it out myself tonight and update the snippet usage. I also have some additional account status checks I will be adding to the handler.
  15. \u00a0 is a no-break space, you shouldn't have those in your code, and it's probably there because you copy / pasted the skeleton from the website in some weird way. Have you tried just writing the code yourself? I'm pretty sure it would work..
  16. This should now be fixed on the SDN What do you mean by the menu doesn't load properly? It works fine for me, perhaps saving or loading messed it up? I will take a look at saving and loading, just avoid it for now.
  17. Write 100 good scripts
  18. Have you tried following these steps?
  19. Pushed a fix for Canifis agility course, it will be available when the SDN is next updated (I will post here again). Thanks
  20. Explv replied to Mr f2p's topic in Introductions
    Welcome
  21. Damn, that's the one course I didn't test. I'll push a fix for the issue tonight.
  22. Hello hello hi Hope you enjoy your stay
  23. Fixed on the SDN Fixed on the SDN Fixed on the SDN Both of the above are now available on the SDN also.

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.