Oliver Queen Posted February 25, 2020 Share Posted February 25, 2020 So Im trying to add the bot if i get messaged 1234 but when i check for 1234 it goes straight to else and the log of the text i checked for says 1234. public void onMessage(Message message) throws InterruptedException { if(message.getType() == Message.MessageType.GAME){ Integer text = Integer.parseInt(message.getMessage()); if(text == 1234) { AddFriend(message.getUsername()); } else { log(text); } } } //Also tried this for line 3 and 4. Integer text = message.getMessage(); if(text == "1234") { Quote Link to comment Share on other sites More sharing options...
Camaro Posted February 25, 2020 Share Posted February 25, 2020 Could just leave it as a string and do text.equals("1234") 2 Quote Link to comment Share on other sites More sharing options...
Oliver Queen Posted February 25, 2020 Author Share Posted February 25, 2020 5 minutes ago, camaro 09 said: Could just leave it as a string and do text.equals("1234") Thanks im new to scripting this worked though. Quote Link to comment Share on other sites More sharing options...