diablos 0 Share Posted January 8, 2017 hi guys, is it possible to look out for: 'I can't reach that!' in the chat log and then execute method if received at all please? Link to comment Share on other sites More sharing options...
Hoodz 161 Share Posted January 8, 2017 hi guys, is it possible to look out for: 'I can't reach that!' in the chat log and then execute method if received at all please? to avoid this issue use: getMap().canReach(Tile) Link to comment Share on other sites More sharing options...
diablos 0 Author Share Posted January 8, 2017 to avoid this issue use: getMap().canReach(Tile) thanks man!!! To answer your question, yes this is possible. In your 'Main' class which extends AbstractScript you have to implement the MessageListener (AdvancedMessageListener maybe) not sure what the difference is. public class Main extends AbstractScript implements AdvancedMessageListener { This will force you to implement a few Methods since its an Interface @Override public void onAutoMessage(Message arg0) { } @Override public void onClanMessage(Message arg0) { } @Override public void onGameMessage(Message arg0) { } @Override public void onPlayerMessage(Message arg0) { } @Override public void onPrivateInMessage(Message arg0) { } @Override public void onPrivateInfoMessage(Message arg0) { } @Override public void onPrivateOutMessage(Message arg0) { } @Override public void onTradeMessage(Message arg0) { } Now everytime you get a Message you can execute Code. In your case I think its a Game-Message so you should add a Method call in the onGameMessage method. For example: @Override public void onGameMessage(Message arg0) { if(arg0.getMessage().equals("I can't reach that")){ foo(); } } This is how you should do it tho thank you too!! very useful thank you very much Link to comment Share on other sites More sharing options...
Neb 7 Share Posted January 8, 2017 I use the servermessage method for this scenario and just have it move my camera up. Seem's to get the job done whenever i have a problem lol. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.