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.

getDefinition().getActions()

Featured Replies

is it just me or is this method broken for anything i do, it keeps returning false.

 

im using it like this

if (trapDoor.getDefinition().getActions().equals("Open"))	{
	log("door is closed");
}else{
	log("door is open");
}

im tried 

  • .equals("open") all lower case
  • .equals("open ") all lower case with a space after the action name 
  • .equals("Open") first letter capitalize
  • .equals("Open ") first letter capitalize with a space after the action name

 

You have to loop through all the actions

		for (String action : trapDoor.getDefinition().getActions())
			if (action.equals("Open"))
				log("Open");
			else
				log("Closed")
  • Author

 

You have to loop through all the actions

		for (String action : trapDoor.getDefinition().getActions())
			if (action.equals("Open"))
				log("Open");
			else
				log("Closed")

 

 

thats a lie because i use this method.

	boolean isTrapDoorClosed()	{
		if (trapDoor!=null)	{
			for (String actions: trapDoor.getDefinition().getActions())	{
				if (actions!=null && actions.contains("open"))	{
					return true;
				}
                else if (actions!=null && actions.contains("climb-down"))	{
                	return false;
                }
			}
		}
		return false;
	}

 and i use it this way

					if (trapDoor!=null)	{
						if (trapDoor.isVisible())	{
							if (this.isDoorClosed())	{
								log("door is closed");

							}else{
								log("door is open");
							}
						}else{
							client.moveCameraToEntity(trapDoor);
							sleep(1000);
						}
					}

Edited by josedpay

You have to loop through all the actions

for (String action : trapDoor.getDefinition().getActions())			if (action.equals("Open"))				log("Open");			else				log("Closed")

thats a lie because i use this method.

boolean isTrapDoorClosed()	{		if (trapDoor!=null)	{			for (String actions: trapDoor.getDefinition().getActions())	{				if (actions!=null && actions.contains("open"))	{					return true;				}                else if (actions!=null && actions.contains("climb-down"))	{                	return false;                }			}		}		return false;	}
and i use it this way
if (trapDoor!=null)	{						if (trapDoor.isVisible())	{							if (this.isDoorClosed())	{								log("door is closed");							}else{								log("door is open");							}						}else{							client.moveCameraToEntity(trapDoor);							sleep(1000);						}					}
You do realize that you are looping through the actions in this method, right?
  • Author

ya im looping throught the action, but it never changes boolean. So i just decided to change it from getAction(). to getVerticalCount()

You have to loop through all the actions

		for (String action : trapDoor.getDefinition().getActions())
			if (action.equals("Open"))
				log("Open");
			else
				log("Closed")

Apparently we are not supposed to use for loops in osbot scripts but conditional sleeping instead.

ya im looping throught the action, but it never changes boolean. So i just decided to change it from getAction(). to getVerticalCount()

 

All you had to do is this..

 

if (Arrays.asList(trapDoor.getDefinition().getActions()).contains("Open"))    {
        log("door is closed");
     }else {
        log("door is open");
    }
Guest
This topic is now closed to further replies.

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.