public class Spammer extends Module{
StringValue mode = new StringValue("Mode", "SpammerMode", this, "Spam", new String[]{"Spam", "Bully"});
NumericValue randomSymbols = new NumericValue("Random Symbols", "SpammerRandom Symbols", this, 5, 1, 10);
NumericValue delay = new NumericValue("Delay", "SpammerDelay", this, 1000, 500, 10000);
TimeUtil timer = new TimeUtil();
ArrayList<String> spamWords;
public Spammer() {
super("Spammer", Category.MISC);
spamWords = new ArrayList<>();
spamWords.add("spam word 1");
spamWords.add("spam word 2");
spamWords.add("spam word 3");
}
@EventTarget
public void onUpdate(final EventUpdate event){
if(mode.getValueString().equalsIgnoreCase("Spam")){
if (timer.hasReached(delay.getValueNumeric())) {
mc.player.sendChatMessage("! [" + RandomStringUtils.random((int) randomSymbols.getValueNumeric(), true, true) + "] " + ListUtil.getRandomItemInArrayList(spamWords));
timer.reset();
}
}
}
}