April 15, 20196 yr 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; } } }
April 15, 20196 yr Make sure you implement MessageListener like this: public class ScriptClass extends Script implements MessageListener and also add: getBot().addMessageListener(this); to your onStart().
April 15, 20196 yr Author 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, 20196 yr by alqqu fix
April 16, 20196 yr 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
Create an account or sign in to comment