Jump to content

Enter Amount boolean snippet


Recommended Posts

Posted (edited)

For those wondering how to find out if the enter amount is up for people to handle it correctly and not miss up. Here the snippet.

 

Best fail safe so a character doesnt type an amount in the chatbox.

	/**
	 * the interface is usually never null, but changes location when visible or not
	 * 
	 * @return true if the 'enter amount' interface is visible
	 */
	public boolean canEnterAmount() {
		RS2Widget warning = getWidgets().get(548, 119);
		return warning != null && !warning.getPosition().equals(new Point(-1,-1));
	}
	

have fun and happy scripting

 

Edited by josedpay
  • Like 5
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...