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

    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

    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

    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.