alqqu Posted April 15, 2019 Share Posted April 15, 2019 hey, im trying to detect if a private message comes trough, but this isnt working and i dont know what the problem is? @Override public void onMessage(Message message) { if (message.getType() == Message.MessageType.PLAYER) { if (message.getMessage().toLowerCase().equals("xfer")) { goldfarm.XFer_Account = message.getUsername(); XFER = true; } } } Quote Link to comment Share on other sites More sharing options...
dazeldo Posted April 15, 2019 Share Posted April 15, 2019 Make sure you implement MessageListener like this: public class ScriptClass extends Script implements MessageListener and also add: getBot().addMessageListener(this); to your onStart(). Quote Link to comment Share on other sites More sharing options...
alqqu Posted April 15, 2019 Author Share Posted April 15, 2019 (edited) 6 minutes ago, dazeldo said: Make sure you implement MessageListener like this: public class ScriptClass extends Script implements MessageListener and also add: getBot().addMessageListener(this); to your onStart(). ty, i did all this and still doesnt work i tried like too public void onMessage(Message msg) { if (msg.getType() == Message.MessageType.PLAYER) { String text = msg.getMessage(); log(text); } } but still doesnt log anything at all *FIX* switched PLAYER to GAME wtf i thought player = is literally someone pming you but the type is GAME instead of it wtf Edited April 15, 2019 by alqqu fix Quote Link to comment Share on other sites More sharing options...
dazeldo Posted April 15, 2019 Share Posted April 15, 2019 Happy to see you fixed it! Quote Link to comment Share on other sites More sharing options...
dreameo Posted April 16, 2019 Share Posted April 16, 2019 23 hours ago, dazeldo said: Make sure you implement MessageListener like this: public class ScriptClass extends Script implements MessageListener and also add: getBot().addMessageListener(this); to your onStart(). Btw, that doesn't actually do anything, it's redundant. Spoiler 97% sure l0l Quote Link to comment Share on other sites More sharing options...