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.

Botre

Members
  • Joined

  • Last visited

Everything posted by Botre

  1. Botre replied to Oliver's topic in Spam/Off Topic
    How did you even manage to survive the explosion?
  2. I'm just confirming that I love Pinocchio and that this picture would make a great avatar.
  3. hey

    Botre replied to korypoo's topic in Introductions
    high
  4. ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^
  5. One-class-state-based scripts tend to have low re-usability. All designs have their flaws, I still like to take out the state machine for little 5-minutes scripts like these :p
  6. If you want something pretty on your head go buy a hat, you sound like a fucking trophy wife.
  7. Went back to basics for simplicity-sake. States are perfect for beginners. This is what an actual Botre onLoop() looks like : @Override public int onLoop() throws InterruptedException { if (isOnline()) { if (eventChopTree.canDo()) eventChopTree.execute(); else if (eventBurnLogs.canDo()) eventBurnLogs.execute(); else eventDropAll.execute(); } return super.onLoop(); }
  8. package org.bjornkrols.lesserdemonkiller; import java.awt.Color; import java.awt.Graphics2D; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; /** * A simple combat script that kills lesser demons, perfect for the caged Lesser demon in the wizard tower. * Does not eat. * For educational purposes. * * @author Bjorn Krols (Botre) */ @ScriptManifest(author = "Botre", info = "Kills lesser demons", logo = "", name = "Lesser demon killer", version = 0) public class LesserDemonKiller extends Script { /** * The name of the monster we will be looking for. */ private static final String NAME = "Lesser demon"; /** * The current time in milliseconds, used to calculate the elapsed amount of seconds. */ private long startTime = System.currentTimeMillis(); /** * The possible states of this script. */ private enum State { DIALOGUE, ATTACK, IDLE; } /** * The current state of this script. */ private State state = State.IDLE; @Override public int onLoop() throws InterruptedException { /* * Find the current state and react accordingly. */ switch (state = getState()) { case DIALOGUE: // Sleep for 600 - 6000 milliseconds (so it looks like we're reading the dialogue). sleep(random.nextInt(6000) + 600); // Click continue on any message with a continue option. getDialogues().clickContinue(); break; case ATTACK: // Find the closest NPC with the name NAME. NPC target = getNpcs().closest(NAME); // Attack the target if it isn't null and exists. if (target != null && target.exists() && target.interact("Attack")) { // If the target was successfully attacked, sleep until player is animating or interacting. new ConditionalSleep(5000, 100) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating() || myPlayer().getInteracting() != null; } }.sleep(); // Don't forget the .sleep(); ! } break; case IDLE: // Nothing is done here, you could add some random behavior though. break; } //Sleep for 300 - 600 milliseconds every loop. return random(300) + 300; } private State getState() { // If a dialogue is pending continuation, go continue it! if (getDialogues().isPendingContinuation()) return State.DIALOGUE; // If we are currently attacking a monster, idle. if (myPlayer().isAnimating() || myPlayer().getInteracting() != null) return State.IDLE; // We are not attacking a monster, let's stop being lazy and get to work! return State.ATTACK; } @Override public void onPaint(Graphics2D g2d) { super.onPaint(g2d); // Set the drawing color to yellow. g2d.setColor(Color.YELLOW); // Draw the current state, useful for debugging. g2d.drawString("State: " + state, 20, 250); // Draw the elapsed amount of seconds since the script was started. g2d.drawString("Elapsed seconds: " + (int) ((System.currentTimeMillis() - startTime) / 1000), 20, 265); } }
  9. If you want to account for both NPCs & Objects: 1. Put all NPCs and RS2Objects in an Entity list. 2. Filter that list for entities that have a "Bank" action. 3. Take a random entity from the list or sort the whole list by distance using a Comparator and take the first one (if you'd like the closest). 4.Profit. Alternatively you can look for the closest NPC and then for the closest Object and then compare the two and take the closest one.
  10. Doesn't work that way ^^ You have to find the entity yourself
  11. getBank() returns an instance of the Bank class, the bank class does not represent an actual bank but rather an "API regarding bank functionality".
  12. Botre replied to 2007's topic in Spam/Off Topic
    2306
  13. 3M 4M Bid expires tomorrow.
  14. Botre replied to 2007's topic in Spam/Off Topic
    2302
  15. Botre replied to 2007's topic in Spam/Off Topic
    2300
  16. Botre replied to 2007's topic in Spam/Off Topic
    2298
  17. Botre replied to 2007's topic in Spam/Off Topic
    2296
  18. Botre replied to 2007's topic in Spam/Off Topic
    2292

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.