The client is offline due to RuneScape update. You may see instance errors but this is due to the update and not actual instance errors. This should be resolved soon. Join our Discord for more information.

chatevent?



  • @Override
    public void notify(ChatMessageEvent chatMessageEvent) {
    String x1 = chatMessageEvent.getSource();
    if(x1.equals(ChatMessageType.ACTION)&& x1.equals("You've caught a orange salamander."))
    salamanderCount++;

    }
    

    Where am i going wrong?

    not working at all


  • Script Writer

    To get the messageType you need to use chatMessageEvent.getType()
    To get the chat message string you need to use chatMessageEvent.getMessage()

    if (chatMessageEvent.getType() == ChatMessageType.FILTERED &&
    		chatMessageEvent.getMessage().equals("You've caught a orange salamander."))  {
    	salamanderCount++;	
    }
    

  • Contributor Script Writer

    You’re checking if the source where the message came from equals your given string


 

36
Online

17.5k
Users

1.5k
Topics

19.6k
Posts