-
Автор темы
- #1
Сливаю вам мой селфкодик)
Java:
package verist.fun.modules.impl.movement;
import com.google.common.eventbus.Subscribe;
import net.minecraft.client.Minecraft;
import verist.fun.events.EventTick;
import verist.fun.modules.api.Category;
import verist.fun.modules.api.Module;
import verist.fun.modules.api.ModuleRegister;
import verist.fun.modules.settings.impl.CheckBoxSetting;
import java.util.Random;
@ModuleRegister(name = "AntiAFK+", category = Category.Movement)
public class AntiAFK extends Module {
private static final Minecraft mc = Minecraft.getInstance();
private static final Random random = new Random();
private static int tickCounter = 0;
private static String lastMessage = "";
public final CheckBoxSetting smoothChat1 = new CheckBoxSetting("Фразы", true);
public AntiAFK(){
addSettings(smoothChat1);
}
private static final String[] SUBJECTS = {
"Кто", "Ты", "Мы", "Я", "Он", "Она", "Они", "Админ"
};
private static final String[] VERBS = {
"видел", "знает", "нашёл", "потерял", "сломал", "построил", "украл", "дал"
};
private static final String[] OBJECTS = {
"ресы", "дом", "меч", "золото", "кирку", "щит", "шалкер", "лук", "тотем"
};
private static final String[] ENDINGS = {
"?", "!", "у тебя?", "у меня.", "на базе.", "в сундуке.", "на спавне."
};
@Subscribe
public void onTick(EventTick event) {
if (mc.player == null) return;
tickCounter++;
if (tickCounter % 100 == 0) {
randomMovement();
}
if (tickCounter % 200 == 0) {
randomJump();
}
if (tickCounter % 300 == 0) {
switchHotbarSlot();
}
if (tickCounter % 500 == 0) {
openAndCloseInventory();
}
if (smoothChat1.getValue() && tickCounter % 3600 == 0) {
chatMessage();
}
}
private static void randomMovement() {
double chance = random.nextDouble();
if (chance < 0.3) {
mc.player.moveForward = 1.0f;
} else if (chance < 0.6) {
mc.player.moveStrafing = 1.0f;
} else {
mc.player.moveForward = 0;
}
}
private static void randomJump() {
if (random.nextBoolean()) {
mc.player.jump();
}
}
private static void switchHotbarSlot() {
int newSlot = random.nextInt(9);
mc.player.inventory.currentItem = newSlot;
}
private static void openAndCloseInventory() {
mc.displayGuiScreen(null);
}
private static void chatMessage() {
String message;
do {
message = generateRandomMessage();
} while (message.equals(lastMessage));
lastMessage = message;
mc.player.sendChatMessage(message);
}
private static String generateRandomMessage() {
return SUBJECTS[random.nextInt(SUBJECTS.length)] + " " +
VERBS[random.nextInt(VERBS.length)] + " " +
OBJECTS[random.nextInt(OBJECTS.length)] + " " +
ENDINGS[random.nextInt(ENDINGS.length)];
}
}
Последнее редактирование: