Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!
RuneMate will permanently shut down on August 7, 2026
due to events outside our control. You can continue using RuneMate until this date after which it will no longer be available. Thank you to everyone that contributed to RuneMate's success and to the community for the opportunity to serve you all these years.

  • Learn about RuneMate Vault and how its zero knowledge local encryption already protects your sensitive information.
  • Edit or delete your RuneMate account from your Account Settings.
  • All account upgrade subscriptions have been cancelled. No action required.

Message Listener

Joined
Jul 31, 2014
Messages
8
So I have the listener implemented now, this is my on message recieved:
Code:
public void onMessageReceived(MessageEvent e) {
        String message = e.getMessage();
        if(e.getType()==MessageEvent.Type.SERVER){
            if(message.contains("boots")&&toAlchID==items[0]){
                rightCupboard =true;
            }else if(message.contains("kiteshield")&&toAlchID==items[1]){
                rightCupboard = true;
            }else if(message.contains("helm")&&toAlchID==items[2]){
                rightCupboard = true;
            }else if(message.contains("Emerald")&&toAlchID==items[3]){
                rightCupboard = true;
            }else if(message.contains("longsword")&&toAlchID==items[4]){
                rightCupboard = true;
            }else{
                rightCupboard = false;
            }
        }
       
    }
The problem is I don't think the listener is ever getting the message. Is there something I have to put in my onStart to start the listener?
 

wyn

Joined
Jul 10, 2014
Messages
66
Impliment messagelistener.
Double check the messagetype.

And please remove that list of else ifs.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
getEventDispatcher().addListener(this) will register the listener with the dispatcher.
 
Joined
Jul 31, 2014
Messages
8
Impliment messagelistener.
Double check the messagetype.

And please remove that list of else ifs.
I knew someone would say something lol. Be polite, it's the support section, I am not releasing snippets here.
 
Joined
Jul 31, 2014
Messages
8
Don't worry about him :p, did any of the suggestions help?
Just trying to call him out so others aren't afraid to post their code in the Support section. I just got off of work, but I am almost positive its the Message type if block now. I will keep you updated. Thanks again!
 
Top