Jump 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. Try this: http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/
  2. Explv replied to WebbyOS's topic in Graphics
    You're welcome.
  3. It should be fairly random as it is?
  4. Area area = new Area(0, 0, 1, 1); getLocalWalker().walk(area.getRandomPosition());
  5. noob?? Learn to Java 8 m8 It is safe to ignore this warning. It is an unchecked generics array creation warning produced by getObjects().filter(). You can just supress it. @SuppressWarnings("unchecked") List<RS2Object> banks = getObjects().filter(obj -> obj.getName().equals("Bank booth")); If you don't want a warning you can always do: List<RS2Object> banks = getObjects().getAll().stream().filter(obj -> obj.getName().equals("Bank booth")).collect(Collectors.toList()); But the first way is perfectly fine and shorter. No it is not anything to worry about.
  6. Explv replied to ni562's topic in Scripting Help
    If the user has saved their username and password in the OSBot settings, it will automatically log in for them. There is no need to create a login script.
  7. Ignore them
  8. It just means: -Get all objects and filter them so that the list only contains objects with the name "Bank booth" -If the list is null, or there are no elements in the list, return null Otherwise return a random value from the list.
  9. This is a bit shorter: public RS2Object getRandomBank() { List<RS2Object> banks = getObjects().filter(obj -> obj.getName().equals("Bank booth")); return (banks == null || banks.size() == 0) ? null : banks.get(random(banks.size()-1)); }
  10. That's what it's supposed to do
  11. Explv replied to ni562's topic in Scripting Help
    Pretty much :P
  12. Explv replied to Acerd's topic in Archive
    Awesome job on your first script! Not issues or anything like that, just possible ways you could improve your code 1) That ft method hurts my fucking eyes This is a bit cleaner: public String formatTime(long ms){ long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24; s %= 60; m %= 60; h %= 24; return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) : String.format("%02d:%02d:%02d", h, m, s); } 2) You don't need to store timeRan in a global variable because it has no use anywhere else in the code, other than where it is calculated. 3) For the state you don't need to store a String value in a variable for output. You can simply override the toString() method in the enum, for example: private enum State { MINE, DROP, SLEEP; @Override public String toString(){ char[] nameArr = name().toLowerCase().toCharArray(); nameArr[0] = Character.toUpperCase(nameArr[0]); return new String(nameArr); } } Then it can be used like: g.drawString("STATE: " + getState().toString(), 15, 80); // this prints out state 4) You have done: getExperienceTracker().startAll(); Considering you are only using one skill (Mining), you should call: getExperienceTracker().start(Skill.MINING);
  13. Explv replied to ni562's topic in Scripting Help
    No problem For more information on the different operators in Java you can take a look at this Java tutorial: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
  14. Explv replied to ni562's topic in Scripting Help
    Yes, it is a logical OR || so the second condition in the OR is not checked if the first evaluates to true. If you were to use a bitwise OR | then both sides of the condition would be checked and a null pointer exception thrown.
  15. Explv replied to ni562's topic in Scripting Help
    Because when the widget is not on screen, when you do getWidegets().get() it will return null. So always make sure you null check
  16. Explv replied to ni562's topic in Scripting Help
    Perhaps you should take a look at the debugging console. You can find it under settings -> show logger. You can then determine your error from the output. Probably a NPE. Your logic and code structure could also use some improvement if(!myPlayer().isAnimating() && !myPlayer().isMoving()){ RS2Widget spinMenu = getWidgets().get(); // Whatever you do to get the spin menu if(spinMenu == null || !spinMenu.isVisible()){ wheel.interact("Spin"); sleep(random(700, 3000)); } else { spinMenu.interact("Make X"); } }
  17. If you have a lot of programming experience in C# you will not find the move to Java difficult at all. They are similar languages. There are still gaps in the selection of scripts that you can fill, and shitty scripts that can be improved. The API does not take a huge time commitment to understand, and there are tutorials out there to help you. It's really up to you if it is worth it
  18. See the first part of the solution i posted, and substitute "Feather" for "Bones" .
  19. private long feathersCollected; private long prevInvCount; @Override public void onStart(){ // initialise previous inventory count to current inventory count prevInvCount = getInventory().getAmount("Feather"); } @Override public int onLoop(){ long invCount = getInventory().getAmount("Feather"); // get number of feathers in inventory // If the amount of feathers has increased, add the change to total feathers collected if(invCount > prevInvCount) feathersCollected += (invCount - prevInvCount); // Update previous inventory count to current count prevInvCount = invCount; ... } (This accounts for if you are banking, or if you are disposing of the items e.g. burying bones) If you aren't banking: private long startFeatherCount; @Override public void onStart(){ startFeatherCount = getInventory().getAmount("Feather"); } private long getFeathersCollected(){ return getInventory().getAmount("Feather") - startFeatherCount; } If you want to make it so that the updating of the count is not paused by the bot's actions, you can move the code in onLoop to the onPaint method. However you should ensure that you limit the amount of times it is called per second.
  20. Explv replied to Krys's topic in Spam/Off Topic
    he seemed like a cool guy dickhead ftfy.
  21. Explv replied to Kenn's topic in Scripting Help
    You should take a look at using a state based system for your scripts. That code could potentially have some bugs in it. For example, what happens if the bank opening process gets interrupted? Your script will just walk back to the fishing spot without having retrieved a lobster pot.
  22. RS2Object closestDoor = getObjects().closest(true, obj -> obj.getName().equals("Door") && obj.hasAction("Open")); if(closestDoor != null) closestDoor.interact("Open");
  23. Try this: http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/ http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/ http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/ http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/
  24. See updated post.

Account

Navigation

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.