Skip to content

Commit

Permalink
0.7.9 AutoCommand and AutoScoreboard added, AutoSign bugs fixed
Browse files Browse the repository at this point in the history
**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
etianl authored Jan 27, 2024
1 parent a087746 commit e94688d
Show file tree
Hide file tree
Showing 7 changed files with 295 additions and 240 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ In no particular order
## Features:
- **Airstrike+:** Rains down whatever entities you desire. It used to only rain fireballs, and I also changed the positioning of the spawning. (Credits to Allah-Hack for the original)
- **AnHero:** Become An Hero! (A quick way back to spawn.) (Credits to etianl :D)
- **AutoCommand:** Automates 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?
- **AutoDrop:** Drops the stack in your selected slot automatically, or you can choose a slot to dump. You can shift click your inventory items to dump your trash easily. (Credits to etianl :D)
- **AutoLavaCaster** Simple timer based bot for lavacasting. Aim at the top of the block you want to cast on and activate the module. It places lava, then after an amount of time removes the lava, places the water after a specified delay, removes it after a specified delay, it will build the mountain upward, tower you up and repeat. Position yourself on a block above and diagonally, mostly perpendicular from the targeted block for best results. (Credits to etianl :D)
- *AutoLavaCaster Notes:*
Expand Down Expand Up @@ -55,6 +56,7 @@ This will return the lowest block placed with AutoMountain until AutoLavacast is
- ForwardKey Turns mountain up, Back Key turns mountain down.
- JumpKey adjusts spacing of stairs according to the OnDemandSpacing value.
- Start building, then hold SneakKey and also hold Left or RightKey as well to build stairs diagonally. Release left or right key first to continue building in the direction you were prior.
- **AutoScoreboard:** Automates the creation of a custom scoreboard. Useful for advertising on griefed servers. Requires OP status. Credits to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll)
- **AutoStaircase:** Builds stairs upward in the direction you are facing by running forward and jumping. (Credits to etianl for bringing it to life! As well as Credits to Frostburn for writing the original. <3) I just had to fix up some stuff for this one but Frostburn had the base code there. I believe this is the first publicly available automatic staircase builder in a Meteor addon, correct me if I'm wrong maybe I didn't have to learn some Java to do this.
- **AutoVclipCommand** Automatically selects the nearest two block gap going either up or down to vclip into. (Credits to etianl, and credits to the original [AutoVclip](https://github.com/kittenvr/AutoVclip) for minecraft 1.19.2 which inspired me to make this one. :D)
- **BaseFinder:** Automatically detects if a Base or Build could be in a chunk by checking every block in each chunk to see if there are "Un-natural" blocks within them. (Credits to etianl :D, and to Meteor-Rejects for some code from newchunks.)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=0.7.8-1.20.4
mod_version=0.7.9-1.20.4
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
254 changes: 127 additions & 127 deletions src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java
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
}
}
Loading

0 comments on commit e94688d

Please sign in to comment.