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 won't open the gate?

Featured Replies

Hello everyone. I got into scripting yesterday and I am currently working on a chicken killing script. Sometimes the bot will get stuck outside.

 

Here is my gate opening code. Why doesn't it work? wacko.png

if(chatbox.contains(MessageType.GAME, "I can't reach that!")) {
				Entity gate = objects.closest("Gate");
				if(gate != null) {
					gate.interact("Open");
				}

I know this isn't the smartest way to implement a check. As if it happens once it will continue to try opening the gate because the message will remain in the chat. But i will fix it later. For now i just want to know why it won't work.

 

 

Edit: Solved the problem.

Edited by flamingstick70

If anyone else has this problem, a solution is to check if the gate is open already, and if it's not open, that's when you run your open command.

 

Credit to Explv for giving me this in the chat box

	public boolean doorIsClosed(RS2Object door) {

		return Arrays.asList(door.getDefinition().getActions()).contains("Open");
		}

 

If anyone else has this problem, a solution is to check if the gate is open already, and if it's not open, that's when you run your open command.

 

Credit to Explv for giving me this in the chat box

	public boolean doorIsClosed(RS2Object door) {

		return Arrays.asList(door.getDefinition().getActions()).contains("Open");
		}

 

If anyone else has this problem, a solution is to check if the gate is open already, and if it's not open, that's when you run your open command.

 

Credit to Explv for giving me this in the chat box

	public boolean doorIsClosed(RS2Object door) {

		return Arrays.asList(door.getDefinition().getActions()).contains("Open");
		}
public boolean doorIsClosed(RS2Object door) {
    return door.hasAction("Open");
}

 

public boolean doorIsClosed(RS2Object door) {
    return door.hasAction("Open");
}

 

Much cleaner, thanks for that.

Much cleaner, thanks for that.

 

You could actually just have something like this:

public boolean openNearestGate() {
    Entity closedGate = getObjects().closest("Gate", (e) -> (e.hasAction("Open"))); //may be incorrect syntax for Objects#closest
    if (closedGate != null) return closedGate.interact("Open");
    return false;
}
  • 2 months later...

I need help. mellow.png

Every time i open the saved and downloaded "osbot"  the from my computer it opens up windows.. How do I get the normal little box where you log in to open up?

I'm not not really tech savvy so please explain EVERYTHING if you can. If you could MSG me or w/e they'll be awesome! Thanks

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.