April 8, 20169 yr Hello, i am trying to make my script stop if the OSBot Client username is not progamerz Tried this code but still logging out if(getClient().getUsername() != "progamerz" ){ log("Take permission from progamerz please."); this.stop(); }
April 8, 20169 yr if and no else ? if(getClient().getUsername().equalsIgnoreCase("Char")){ log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized"); } else { log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!"); stop(); } Edited April 8, 20169 yr by Charlotte
April 8, 20169 yr you have to use comparators with non-value types, namely .equals() in this case. try if(!getClient().getUsername().equals("progamerz") ){ log("Take permission from progamerz please."); this.stop(); }
April 9, 20169 yr Author if and no else ? if(getClient().getUsername().equalsIgnoreCase("Char")){ log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized"); } else { log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!"); stop(); } you have to use comparators with non-value types, namely .equals() in this case. try if(!getClient().getUsername().equals("progamerz") ){ log("Take permission from progamerz please."); this.stop(); } Will try and let u know! EDIT : both working thanks! Edited April 9, 20169 yr by progamerz
Create an account or sign in to comment