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
  • I can't reach that! [Question]


    diablos
     Share

    Recommended Posts

    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

    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

    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

    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

     Share

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