Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How to check if a player has tried to trade me?


    HinduKush

    Recommended Posts

    Posted

    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 :)

    Posted

    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 :)
        
      }
      
      
    }

     

    Posted
    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 :)

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.