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
  • addListener


    Scorpius

    Recommended Posts

    I've created a listener like this

    private InventoryListener ItemChangeListener = new InventoryListener()
    {       
        @Override
        public void onItemChange(Item[] items)
        {
           
        }
    };

    And I register it using this code

    getClient().getInstance().addEventListener(ItemChangeListener);
    

    But it doesn't seem to trigger, any ideas?

    Link to comment
    Share on other sites

    • 2 weeks later...

    I didn't know there was a way to add listeners in Dreambot, I upvote this to see somebodies solution!

    I remember seeing something from a mod/manager regarding the usage of addListener but I forgot how it was done

     

    BUMP: Still looking for an answer, I'm trying to add a listener without making the script class implement it

    Link to comment
    Share on other sites

    • 7 months later...

    I didn't check it yet LOL, Trying now

    public class Script extends AbstractScript implements InventoryListener {
    
       ...
    
       @Override
       public void onItemChange(Item... items) {
    
       }
    
    }
    
    Link to comment
    Share on other sites

    public class Script extends AbstractScript implements InventoryListener {
    
       ...
    
       @Override
       public void onItemChange(Item... items) {
    
       }
    
    }
    

    Caused bugs on quickstart, the script freezes (or stops idk, been a while since i last tested it)

    Link to comment
    Share on other sites

    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.