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.

Script getting stuck in a loop

Featured Replies

	case WALK_TO_WHEEL:
			status = "Walking to wheel";
			if (myPlayer().getZ() == 2) {
				this.localWalker.walkPath(BANK_TO_STAIRS);
				sleep(random(1500,2000));
				Entity stairs = objects.closest("Staircase");
				if (stairs != null
						&& stairs.exists()
						&& Arrays.asList(stairs.getDefinition().getActions())
								.contains("Climb-down"))
					stairs.interact("Climb-down");
				sleep(random(1000, 1200));
			}
			if (myPlayer().getZ() == 1) {
				Entity door = objects.closest(new Area(3207,3214,3208,3214),"Door");
				Entity wheel = objects.closest("Spinning wheel");
				if (door != null && door.exists())
					if (Arrays.asList(door.getDefinition().getActions())
							.contains("Open")) 
					{
						door.interact("Open");
						sleep(random(1500, 1600));
						this.localWalker.walk(wheel.getX(), wheel.getY() + 1);
						log("Hello");
					}
				this.localWalker.walk(wheel.getX(), wheel.getY() + 1);
				sleep(random(400, 500));

			}
			break;

So all my code works, everything else is flawless, except if it catches that the door contains open, then it opens the door then stands there. It reaches the cod under it, because i added a log check and it will spam it in chat. Can't figure it out

Make a filter for the door with the following checks:

 

- hasAction("Open");

- getY() <= Y (y being the y coordinate of the door closer to the stairs, not the second door for rune mysteries)

 

if ^ that door exists, open it, if not, click the spinner and proceed with spinning.

	public static Filter<RS2Object> LUMBRIDGE_SOUTH_DOOR = new Filter<RS2Object>() {
		@Override
		public boolean match(RS2Object o) {
			if (o != null
					&& (o.hasAction("Open"))
					&& o.getY() < YYYY
					&& o.getName().equalsIgnoreCase("Door")) {
				return true;
			}
			return false;
		}
	};
  • Author

 

Make a filter for the door with the following checks:

 

- hasAction("Open");

- getY() <= Y (y being the y coordinate of the door closer to the stairs, not the second door for rune mysteries)

 

if ^ that door exists, open it, if not, click the spinner and proceed with spinning.

	public static Filter<RS2Object> LUMBRIDGE_SOUTH_DOOR = new Filter<RS2Object>() {
		@Override
		public boolean match(RS2Object o) {
			if (o != null
					&& (o.hasAction("Open"))
					&& o.getY() < YYYY
					&& o.getName().equalsIgnoreCase("Door")) {
				return true;
			}
			return false;
		}
	};

 

So then instead of having all those checks I can just have LUMBIDGESOUTHDOOR? since it's already being filtered?

 

Edited by twin 763

  • Author

You forgot to add spinningWheel.interact("Use"), that's why it's not doing anything

 

I have that in my other case, Once it gets into the spinning room, it executes the SPIN case, i guess i can try extending the area out a few blocks.

 

That actually fixed it lol, gonna see how reliable this is.

Edited by twin 763

Ah I guess you can make it so if the closed door doesn't exist, then go to the SPIN case (use the spinning wheel)

 

(lumbridgeDoor == null || area.contains(myPosition) to set the SPIN state, otherwise it will just walk to the room redundantly, when it can just click the spinning wheel and immediately start spinning ;)

Edited by Czar

  • Author

Ah I guess you can make it so if the closed door doesn't exist, then go to the SPIN case (use the spinning wheel)

 

(lumbridgeDoor == null || area.contains(myPosition) to set the SPIN state, otherwise it will just walk to the room redundantly, when it can just click the spinning wheel and immediately start spinning wink.png

 

 I'll mess around with both ways tomorrow, when i got to get my proggies done

Lol nice spinner script, it is not so easy to be cheesy like me. :doge:

Edited by josedpay

  • Author

Lol nice spinner script, it is not so easy to be cheesy like me. doge.png

 

What do you mean? tongue.png

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

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.