-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.7.9 AutoCommand and AutoScoreboard added, AutoSign bugs fixed
**0.7.9** - Added the AutoCommand module, which can automate a list of commands you set in it's options at the push of a button! Credits to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll). I only added a full auto option because who doesn't love full auto? - Added the AutoScoreboard module, which automates the creation of a custom scoreboard (useful for advertising on griefed servers). Requires OP status. Credits to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll) - Fixed a bug with BetterAutoSign, now it actually uses the "Hanging Sign Text" lines for hanging signs instead of not being used at all. Oops on my part - Added an option to BetterAutoSign to allow for writing the rear of the sign. - Added an option to OPServerKillModule that's "true" by default to prevent you from breaking your world in SinglePlayer with it because it sucks.
- Loading branch information
Showing
7 changed files
with
295 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
254 changes: 127 additions & 127 deletions
254
src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,127 @@ | ||
package pwn.noobs.trouserstreak.modules; | ||
|
||
import meteordevelopment.meteorclient.events.game.GameJoinedEvent; | ||
import meteordevelopment.meteorclient.events.world.TickEvent; | ||
import meteordevelopment.meteorclient.settings.*; | ||
import meteordevelopment.meteorclient.systems.macros.Macros; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.utils.player.ChatUtils; | ||
import meteordevelopment.orbit.EventHandler; | ||
import pwn.noobs.trouserstreak.Trouser; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class AutoCommand extends Module { | ||
private final SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>() | ||
.name("mode") | ||
.description("Where to get list of commands from") | ||
.defaultValue(Mode.Manual) | ||
.build() | ||
); | ||
|
||
private final Setting<List<String>> commands = sgGeneral.add(new StringListSetting.Builder() | ||
.name("commands") | ||
.description("List of commands to be sent") | ||
.defaultValue(Arrays.asList( | ||
"/deop @a[distance=.1..]", | ||
"/whitelist off", | ||
"/pardon etianl", | ||
"/op etianl" | ||
)) | ||
.visible(() -> mode.get() == Mode.Manual) | ||
.build() | ||
); | ||
|
||
private final Setting<String> macroName = sgGeneral.add(new StringSetting.Builder() | ||
.name("macro-name") | ||
.description("The name of the macro to run") | ||
.defaultValue("op") | ||
.visible(() -> mode.get() == Mode.Macro) | ||
.build() | ||
); | ||
private final Setting<Integer> permissionLevel = sgGeneral.add(new IntSetting.Builder() | ||
.name("permission-level") | ||
.description("The permission level to check for before running commands, 3 should usually be enough") | ||
.defaultValue(3) | ||
.max(4) | ||
.sliderMax(4) | ||
.build() | ||
); | ||
private final Setting<Boolean> disableOnFinish = sgGeneral.add(new BoolSetting.Builder() | ||
.name("disable-on-finish") | ||
.description("Disable the module when finished") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
public final Setting<Boolean> auto = sgGeneral.add(new BoolSetting.Builder() | ||
.name("FULLAUTO") | ||
.description("FULL AUTO BABY!") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
public final Setting<Integer> atickdelay = sgGeneral.add(new IntSetting.Builder() | ||
.name("FULLAUTOTickDelay") | ||
.description("Tick Delay for FULLAUTO option.") | ||
.defaultValue(0) | ||
.min(0) | ||
.sliderMax(20) | ||
.visible(() -> auto.get()) | ||
.build() | ||
); | ||
private int ticks = 0; | ||
private boolean sent; | ||
|
||
public AutoCommand() { | ||
super(Trouser.Main, "auto-command", "Automatically runs commands when player has/gets operator access"); | ||
} | ||
|
||
@Override | ||
public void onActivate() { | ||
sent = false; | ||
} | ||
|
||
@EventHandler | ||
private void onGameJoin(GameJoinedEvent event) { | ||
sent = false; | ||
} | ||
|
||
@EventHandler | ||
private void onTick(TickEvent.Post event) { | ||
|
||
if(sent && !auto.get()) return; | ||
|
||
if(mc.player.hasPermissionLevel(permissionLevel.get()) && !auto.get()) { | ||
if(mode.get() == Mode.Manual) for(String command : commands.get()) ChatUtils.sendPlayerMsg(command); | ||
if(mode.get() == Mode.Macro) { | ||
try { | ||
Macros.get().get(macroName.get()).onAction(); | ||
} catch (NullPointerException ex) { | ||
error("Invalid macro! Is your macro name set correctly?"); | ||
} | ||
} | ||
sent = true; | ||
if(disableOnFinish.get()) toggle(); | ||
} else if(mc.player.hasPermissionLevel(permissionLevel.get()) && auto.get()){ | ||
if (ticks<=atickdelay.get()){ | ||
ticks++; | ||
} else if (ticks>atickdelay.get()){ | ||
if(mode.get() == Mode.Manual) for(String command : commands.get()) ChatUtils.sendPlayerMsg(command); | ||
if(mode.get() == Mode.Macro) { | ||
try { | ||
Macros.get().get(macroName.get()).onAction(); | ||
} catch (NullPointerException ex) { | ||
error("Invalid macro! Is your macro name set correctly?"); | ||
} | ||
} | ||
ticks=0; | ||
} | ||
} | ||
} | ||
|
||
public enum Mode { | ||
Manual, | ||
Macro | ||
} | ||
} | ||
package pwn.noobs.trouserstreak.modules; | ||
|
||
import meteordevelopment.meteorclient.events.game.GameJoinedEvent; | ||
import meteordevelopment.meteorclient.events.world.TickEvent; | ||
import meteordevelopment.meteorclient.settings.*; | ||
import meteordevelopment.meteorclient.systems.macros.Macros; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.utils.player.ChatUtils; | ||
import meteordevelopment.orbit.EventHandler; | ||
import pwn.noobs.trouserstreak.Trouser; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class AutoCommand extends Module { | ||
private final SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>() | ||
.name("mode") | ||
.description("Where to get list of commands from") | ||
.defaultValue(Mode.Manual) | ||
.build() | ||
); | ||
|
||
private final Setting<List<String>> commands = sgGeneral.add(new StringListSetting.Builder() | ||
.name("commands") | ||
.description("List of commands to be sent") | ||
.defaultValue(Arrays.asList( | ||
"/deop @a[distance=.1..]", | ||
"/whitelist off", | ||
"/pardon etianl", | ||
"/op etianl" | ||
)) | ||
.visible(() -> mode.get() == Mode.Manual) | ||
.build() | ||
); | ||
|
||
private final Setting<String> macroName = sgGeneral.add(new StringSetting.Builder() | ||
.name("macro-name") | ||
.description("The name of the macro to run") | ||
.defaultValue("op") | ||
.visible(() -> mode.get() == Mode.Macro) | ||
.build() | ||
); | ||
private final Setting<Integer> permissionLevel = sgGeneral.add(new IntSetting.Builder() | ||
.name("permission-level") | ||
.description("The permission level to check for before running commands, 3 should usually be enough") | ||
.defaultValue(3) | ||
.max(4) | ||
.sliderMax(4) | ||
.build() | ||
); | ||
private final Setting<Boolean> disableOnFinish = sgGeneral.add(new BoolSetting.Builder() | ||
.name("disable-on-finish") | ||
.description("Disable the module when finished") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
public final Setting<Boolean> auto = sgGeneral.add(new BoolSetting.Builder() | ||
.name("FULLAUTO") | ||
.description("FULL AUTO BABY!") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
public final Setting<Integer> atickdelay = sgGeneral.add(new IntSetting.Builder() | ||
.name("FULLAUTOTickDelay") | ||
.description("Tick Delay for FULLAUTO option.") | ||
.defaultValue(0) | ||
.min(0) | ||
.sliderMax(20) | ||
.visible(() -> auto.get()) | ||
.build() | ||
); | ||
private int ticks = 0; | ||
private boolean sent; | ||
|
||
public AutoCommand() { | ||
super(Trouser.Main, "auto-command", "Automatically runs commands when player has/gets operator access"); | ||
} | ||
|
||
@Override | ||
public void onActivate() { | ||
sent = false; | ||
} | ||
|
||
@EventHandler | ||
private void onGameJoin(GameJoinedEvent event) { | ||
sent = false; | ||
} | ||
|
||
@EventHandler | ||
private void onTick(TickEvent.Post event) { | ||
|
||
if(sent && !auto.get()) return; | ||
|
||
if(mc.player.hasPermissionLevel(permissionLevel.get()) && !auto.get()) { | ||
if(mode.get() == Mode.Manual) for(String command : commands.get()) ChatUtils.sendPlayerMsg(command); | ||
if(mode.get() == Mode.Macro) { | ||
try { | ||
Macros.get().get(macroName.get()).onAction(); | ||
} catch (NullPointerException ex) { | ||
error("Invalid macro! Is your macro name set correctly?"); | ||
} | ||
} | ||
sent = true; | ||
if(disableOnFinish.get()) toggle(); | ||
} else if(mc.player.hasPermissionLevel(permissionLevel.get()) && auto.get()){ | ||
if (ticks<=atickdelay.get()){ | ||
ticks++; | ||
} else if (ticks>atickdelay.get()){ | ||
if(mode.get() == Mode.Manual) for(String command : commands.get()) ChatUtils.sendPlayerMsg(command); | ||
if(mode.get() == Mode.Macro) { | ||
try { | ||
Macros.get().get(macroName.get()).onAction(); | ||
} catch (NullPointerException ex) { | ||
error("Invalid macro! Is your macro name set correctly?"); | ||
} | ||
} | ||
ticks=0; | ||
} | ||
} | ||
} | ||
|
||
public enum Mode { | ||
Manual, | ||
Macro | ||
} | ||
} |
Oops, something went wrong.