HinduKush 0 Posted August 14, 2018 I want to check if a person is sending an request to trade me, in this situation I don't know the username of the player, is this possible? and if so, how? Thank you in advance
Banker 175 Posted August 14, 2018 You can extend AdvancedMessageListener and use the onTradeMessage function EG. public class Main extends AbstractScript implements AdvancedMessageListener { public int onLoop() { return 0; } // Other functions... private void onTradeMessage(Message message) { // In here you can get the details of the trade. String trade_username = message.getUsername(); // This function will only show you Trade messages (and duel if I'm remembering correctly) // It will automatically be called when you receive a Trade message :) } }
HinduKush 0 Author Posted August 15, 2018 On 8/14/2018 at 5:47 PM, Banker said: You can extend AdvancedMessageListener and use the onTradeMessage function EG. public class Main extends AbstractScript implements AdvancedMessageListener { public int onLoop() { return 0; } // Other functions... private void onTradeMessage(Message message) { // In here you can get the details of the trade. String trade_username = message.getUsername(); // This function will only show you Trade messages (and duel if I'm remembering correctly) // It will automatically be called when you receive a Trade message :) } } Thanks for your help! Worked out
Recommended Posts
Archived
This topic is now archived and is closed to further replies.