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. it only walks to a random position in the area, if it's already in the area That is because the walker uses default WalkingEvent which walks with a minthreshold of 2 tiles. You should either wait for WalkingEvent to be fixed (if its broken) or just walk to a position deep in the area rather than a random one?
  2. That is incorrect, and also he said walker.walk doesn't work
  3. You should use WakingEvent, however I feel like the min threshold stuff might not be working right now. You could try: MainScreenTileDestination destination = new MainScreenTileDestination(getBot(), area.getRandomPosition()); getMouse().click(destination); or: MiniMapTileDestination destination = new MiniMapTileDestination(getBot(), area.getRandomPosition()); getMouse().click(destination);
  4. walking.walk(area.getRandomPosition()); or walking.webWalk(area.getRandomPosition()); ?
  5. You are right, I wasn't thinking about the drawImage methods in Graphics.
  6. Explv replied to gorgas8's topic in Scripting Help
    Your logic is flawed that's why. You have nested if(random == 2) inside if(random == 1). So the code inside if(random == 2) will never be executed, because it can only be reached if random = 1... It should look more like: public void antiBan2() throws InterruptedException { int random = random(1,3); switch(random){ case 1: sleep(random(1000, 2000)); mouse.moveRandomly(random(1000, 2000)); break; case 2: sleep(random(1000, 2000)); mouse.moveRandomly(random(300, 1000)); mouse.moveRandomly(random(1000, 2000)); break; } } That is because the walker in OSBot walks to a position within (i think) 2 tile accuracy. If you want it to walk to the exact tile, you will need to create your own WalkingEvents.
  7. deleted answer Ignore the stupid shit I said
  8. -Deleted duplicate-
  9. Explv replied to Explv's topic in Others
    Thanks It will be free, just waiting for the script to be uploaded :P
  10. Paste your exact code?
  11. My bad i thought you could chain them. In that case just separate it like this: WalkingEvent walkingEvent = new WalkingEvent(position); walkingEvent.setMinDistanceThreshold(0); execute(walkingEvent);
  12. Colouring every tile that your player walks to: private final List<Position> WALKED_POSITIONS = new ArrayList<>(); @Override public void onPaint(Graphics2D g){ updateWalkedPositions(); drawWalkedPositions(g); } private void updateWalkedPositions(){ if(!WALKED_POSITIONS.contains(myPosition())) WALKED_POSITIONS.add(myPosition()); } private void drawWalkedPositions(Graphics2D g){ for(Position position : WALKED_POSITIONS) fillPositionOnScreen(position, g); } private void fillPositionOnScreen(Position position, Graphics2D g){ Polygon polygon = position.getPolygon(script.getBot()); g.fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); }
  13. Do you mean a predefined path? Or colour all the tiles that your player walks to?
  14. WalkingEvent walkingEvent = new WalkingEvent(position); walkingEvent.setMinDistanceThreshold(0); execute(walkingEvent);
  15. Titled Border https://docs.oracle.com/javase/7/docs/api/javax/swing/border/TitledBorder.html
  16. You can use "Explv's Location Assistant" in the Other section, and just copy-paste your path, it will show on screen.
  17. Maybe the door is not called "Door". Or the area you passed does not contain the door.
  18. Explv replied to Explv's topic in Others
    Yes there are 6 different zoom levels, with each increasing zoom level the map is loaded from an increasing number of images. At zoom level 8, the map is ~50,000 images, and the images are loaded dynamically, so it only loads the images that you can see in the current position.
  19. Explv posted a topic in Others
    A simple walking script, select your destination and hit start! Price: $1 Purchase Link: https://osbot.org/forum/store/product/675-explvs-walker/ CLI: No preset location: java -jar "/path/to/osbot.jar" -login OSBotUser:OSBotPassword -bot RSUser:RSPassword:RSPin -script 819:none With coordinates (they can be obtained using my map https://explv.github.io/) java -jar "/path/to/osbot.jar" -login OSBotUser:OSBotPassword -bot RSUser:RSPassword:RSPin -script 819:x.y.z Using location name: java -jar "/path/to/osbot.jar" -login OSBotUser:OSBotPassword -bot RSUser:RSPassword:RSPin -script 819:LOCATION_NAME List of currently supported CLI location names:
  20. I think you should try and clean up your code a bit. Generally if your code is cleaner, it is easier to spot bugs / optimisations. Here is how you could clean up this class for example. You have two different halls each with the same properties, but different values. So you should probably create an enum to store this information: import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; public enum Hall { // TODO: Define these EAST (null, null, null), WEST (null, null, null); final Area HALL_AREA, FIGHT_AREA; final Position[] FIGHT_POS; Hall(final Area HALL_AREA, final Area FIGHT_AREA, final Position[] FIGHT_POS){ this.HALL_AREA = HALL_AREA; this.FIGHT_AREA = FIGHT_AREA; this.FIGHT_POS = FIGHT_POS; } public static Hall getHall(Position playerPosition){ return Hall.EAST.HALL_AREA.contains(playerPosition) ? Hall.EAST : Hall.WEST.HALL_AREA.contains(playerPosition) ? Hall.WEST : null; } public static boolean inFightArea(Position playerPosition){ return EAST.FIGHT_AREA.contains(playerPosition) || WEST.FIGHT_AREA.contains(playerPosition); } public static Area getFightArea(Position playerPosition){ Hall hall = getHall(playerPosition); return hall != null ? hall.FIGHT_AREA : null; } } Seeing as you are sleeping at the end of the execute method, why not just change the return type of execute to an int, and perform the sleep in onLoop. Also I am guessing you have that state() method in every class, so you might as well just put this method into the base Node class: import org.osbot.rs07.script.Script; public abstract class Node { protected final Script S; private final String STATUS; public Node(final Script S, final String STATUS){ this.S = S; this.STATUS = STATUS; } public String status(){ return STATUS; } public abstract boolean validate() throws InterruptedException; public abstract int execute() throws InterruptedException; } Once I cleaned stuff up the code looks like: import org.osbot.rs07.api.map.Area; import org.osbot.rs07.script.Script; import org.osbot.rs07.input.mouse.MiniMapTileDestination; import org.osbot.rs07.utility.ConditionalSleep; public class PickRoom extends Node { public PickRoom(final Script S) { super(S, "Choosing Fight Room"); } public boolean validate() throws InterruptedException { return !Hall.inFightArea(S.myPosition()) && hasFood(); } private boolean hasFood() { return S.getInventory().contains(Constants.FOOD); } public int execute() throws InterruptedException { final Area FIGHT_AREA = Hall.getFightArea(S.myPosition()); if (!canReachFightArea(FIGHT_AREA)) openFightAreaDoor(FIGHT_AREA); else walkInsideFightArea(); return (250 + Script.random(750)); } private boolean canReachFightArea(final Area FIGHT_AREA){ return S.getMap().canReach(FIGHT_AREA.getRandomPosition()); } private void openFightAreaDoor(final Area FIGHT_AREA){ if(S.getDoorHandler().handleNextObstacle(FIGHT_AREA)){ new ConditionalSleep(5_000) { @Override public boolean condition() throws InterruptedException { return S.getMap().canReach(FIGHT_AREA.getRandomPosition()); } }.sleep(); } } /** * * S.getLocalWalker().walk(getFightPos()); * S.walk.walkPath(getFightPos()); * For some reason these wouldn't walk into the room because * the tile I was trying to walk to was too close to my character */ private void walkInsideFightArea(){ Hall hall = Hall.getHall(S.myPosition()); if(hall != null) { S.getMouse().click(new MiniMapTileDestination(S.getBot(), hall.FIGHT_POS[0]), false); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return Hall.inFightArea(S.myPosition()); } }.sleep(); } } }
  21. For that you would do something like: g.fill(npc.getModel().getBoundingBox(npc.getGridX(), npc.getGridY(), npc.getZ())); Note: use g.fill to create a filled in rectangle, or g.draw if you just want the outline.
  22. @Override public void onPaint(Graphics2D g){ g.setColor(Color.RED); g.fill(new MiniMapTileDestination(getBot(), npc.getPosition()).getBoundingBox().getBounds2D()); }

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.