Bredz 6 Posted July 4, 2019 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.
Neffarion 486 Posted July 4, 2019 You are implementing an interface on a class, so you have to add every function is requires You need to add all those functions. They can be empty if you don't need anything from them
Bredz 6 Author Posted July 4, 2019 10 minutes ago, Neffarion said: You are implementing an interface on a class, so you have to add every function is requires 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.
Nuclear Nezz 2107 Posted July 4, 2019 Are you not using an IDE? It should be flagging things as red if there are errors.
Neffarion 486 Posted July 4, 2019 Illegal character must be from something else you didn't post. What is in getRock?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.