Jump to content

Checking If Banned - Custom Login Handler?


Recommended Posts

Posted (edited)

Is there a way to check if the account is banned when trying to log in with the login manager disabled? Besides checking for yellow pixels at locations where the account disabled text shows up, is there a better way to check if the account has been banned? I looked at the OSBot login manager code and they have  some sort of response codes but its obfuscated so I cant really tell exactly whats going on or how they read those response codes.

 

 

EDIT SWAG YOLO WITH TOKENS IDEA:

package script;

import org.osbot.rs07.constants.ResponseCode;
import org.osbot.rs07.listener.LoginResponseCodeListener;
import org.osbot.rs07.script.Script;

public class LoginListener implements LoginResponseCodeListener {
	Script context;

	public LoginListener(Script context) {
		this.context = context;
	}

	@Override
	public void onResponseCode(int response) throws InterruptedException {
		if (response == ResponseCode.ACCOUNT_DISABLED) {
			context.log("BANNED");
		}

	}

}

In my main.java login thread:

getBot().getLoginResponseCodeListeners().add(new LoginListener(getScript()));

9fff1b60e7b1356c04144c329d38cc47.png

Edited by LoudPacks
Posted (edited)

Can use their onResponseCode(ResponseCode.ACCOUNT_DISABLED), no? Oops, read it wrong. lol

 

That seems like exactly what I would need. Something like this

Example:

	@Override
    public void onResponseCode(int code) { 
	if(c.getType().equals(ResponseCode.ACCOUNT_DISABLED))
		log("BANNED");
	}

 

The thing is tho, my code is all ran on a separate thread so how would I make sure that is called since the main thread is sleeping when the login manager is disabled?

 

Edited by LoudPacks

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...