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


    Bredz

    Recommended Posts

    Hey guys, I'm trying to grab messages from the chat-log but I cant seem to get it to work.
    currently I have this

    public class main extends AbstractScript implements AdvancedMessageListener {
        @Override
        public void onGameMessage(Message msg) {
            if (msg.getMessage().toLowerCase().contains("i can't reach that!")) {
                getCamera().rotateToEntity(getRock());
                log("Cant reach move camera");
            }
        }
    }

     

     

    However I'm getting this error everytime.

    "'main' must either be declared abstract or implement abstract method 'onAutoMessage(Message)' in 'AdvancedMessageListener'"

    Along with Illegal Character errors and ' ; ' expected.

    What am I doing wrong here.

    Link to comment
    Share on other sites

    10 minutes ago, Neffarion said:

    You are implementing an interface on a class, so you have to add every function is requires

    caqYuWT.png

    You need to add all those functions. They can be empty if you don't need anything from them

        @Override
        public void onMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
        
        @Override
        public void onAutoMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onClanMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onPlayerMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onPrivateInMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onPrivateInfoMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onPrivateOutMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onTradeMessage(Message arg0) {
            // TODO Auto-generated method stub
        }
    
        @Override
        public void onGameMessage(Message msg) {
            if (msg.getMessage().toLowerCase().contains("i can't reach that!")) {
                getCamera().rotateToEntity(getRock());
                log("Cant reach move camera");
            }
        }

    This is still getting me the illegal character error.

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