I've seen in quite a few scripts that for Make X people use random(28, 1000) or something similar... (I'm guilty of this), So I made one that is a decent bit more inconspicuous.
public String makeX() {
int num = random(1, 9);
int length = random(2, 4);
String finishednum = "";
if (num < 3) {
length = random(3, 4);
}
for (int i = 0; i < length; i++) {
finishednum += "" + random(num - 1, num > 8 ? num : num + 1);
}
if (Integer.parseInt(finishednum) < 28) {
return makeX();
}
return finishednum;
}
By default if it makes less than 28, it will loop back into the function. You'll get results like 122, 988, 77, 34, 343, ect. Instead of results like 294, 984, 349, 28, 69, 77. Random isn't a horrible result, but it looks like you smash your number pad. But in real life, we generally do numbers that are close to each other, hence + 1, - 1; TLDR; Small anti-ban. It's pretty simple, but I figured someone could use it.