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
  • Try asking for help in the chatbox
  • addListener


    Scorpius
     Share

    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?

    Edited by zScorpio
    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

    Edited by zScorpio
    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)

    Edited by zScorpio
    Link to comment
    Share on other sites

    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
     Share

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