Jump to content

How to check if user is trading you


GaetanoH

Recommended Posts

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
Link to comment
Share on other sites

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;
	}

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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