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.

Handling doors then do action

Featured Replies

Im trying to get my script to walk from location1 to location2 and on the way to location2 there is a door that needs to be opened once opened i want to use a item in my inventory on a object but the problem im having is on the way there when i get to the door script tries to use my inventory item on object even though door is closed, but sometimes rarely will open door then use item on object, posted code below kinda-iffy just really tired atm.

 

if(!UI.cookingArea.contains(myPlayer())) {
    			setStatus("Walking to range/fire.");
    			getWalking().webWalk(UI.cookingArea);
    			if(getDoorHandler().handleNextObstacle(UI.cookingArea)) {
    				new ConditionalSleep(5000) {
						@Override
						public boolean condition() throws InterruptedException {
							return getMap().canReach(range);
						}
					}.sleep();
    			}
    		}
    		if (!getWidgets().isVisible(270, 14)) {
    			setStatus("Using food on range/fire.");
    			getInventory().interact("Use", UI.foodType);
    			if (range.interact("Use")) {
					new ConditionalSleep(2000) {
						@Override
						public boolean condition() throws InterruptedException {
							return getWidgets().isVisible(270, 14);
						}
					}.sleep();
				}
    		}
		 else {
			if (getWidgets().interact(270, 14, "Cook")) {
				setStatus("Cooking food.");
				new ConditionalSleep(100_000) {
					@Override
					public boolean condition() throws InterruptedException {
						return !inventory.contains("Raw") || getDialogues().isPendingContinuation();
					}
				}.sleep();
				if(getDialogues().isPendingContinuation()) {
					getDialogues().clickContinue();
				}
			}
		}

 

Don't handle doors if you are using web walking. Right now it looks like you're trying to web walk to the area first and then open the door? Since these are static areas and I'm sure you're not traversing the map, save 1-2GB of member and don't use web walking.

If the door is in the same region as the bank (I sure as hell hope it is), then on the script start grab the door object. Create a WalkingEvent and set the break condition to if the door is closed. If the door is closed, WalkingEvent will break, then you can handle the door.


Additionally:
You aren't disposing your GUI, this is lost memory. Dispose of your GUI and keep your variables contained in the script (aka no more GUI.getArea). Also your script will break within a month with all those static ids. 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

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.