Jump to content

How to check if user is trading you


Recommended Posts

Posted (edited)
2 minutes ago, GaetanoH said:

Yeah, getType returns a: receivedTrade. 

Thank you!

That's when you are already trading, I ment getting the trade request

If you're trying to check that a certain user send the request, you can parse the game message using the API class I sent in my previous post.

Edited by harrypotter
Posted
18 minutes ago, GaetanoH said:

Yeah, getType returns a: receivedTrade. 

Thank you!

That's when you are already trading, I ment getting the trade request

I made this to grab the name from messages:

public String getNameFromTrade(String s) {
		String line = "";

		for (int i = 0; i < s.length(); i++) {
			if (s.substring(i, i + 4).contains("wish"))
				break;
			else
				line += s.substring(i, i + 1);
		}

		return line;
	}

 

Posted
32 minutes ago, scape said:

I made this to grab the name from messages:


public String getNameFromTrade(String s) {
		String line = "";

		for (int i = 0; i < s.length(); i++) {
			if (s.substring(i, i + 4).contains("wish"))
				break;
			else
				line += s.substring(i, i + 1);
		}

		return line;
	}

 

Lol, you can check it from the Message API man, 

if(msg.getType() == Message.MessageType.RECEIVE_TRADE){
    log("TRADING: " + msg.getUsername());
}

 

  • Like 1

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