February 25, 20205 yr 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") {
February 25, 20205 yr Author 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.
Create an account or sign in to comment