Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hack: MurderMystery + .mm command #963

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/command/CmdList.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public final class CmdList
public final JumpCmd jumpCmd = new JumpCmd();
public final LeaveCmd leaveCmd = new LeaveCmd();
public final ModifyCmd modifyCmd = new ModifyCmd();
public final MurderMysteryCmd murderMysteryCmd = new MurderMysteryCmd();
public final PathCmd pathCmd = new PathCmd();
public final PotionCmd potionCmd = new PotionCmd();
public final ProtectCmd protectCmd = new ProtectCmd();
Expand Down
95 changes: 95 additions & 0 deletions src/main/java/net/wurstclient/commands/MurderMysteryCmd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2014-2024 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.commands;

import net.wurstclient.command.CmdException;
import net.wurstclient.command.CmdSyntaxError;
import net.wurstclient.command.Command;
import net.wurstclient.hacks.MurderMysteryHack;
import net.wurstclient.util.ChatUtils;

public class MurderMysteryCmd extends Command
{
public MurderMysteryCmd()
{
super("mm",
"Manages current MurderMystery session statistics and information about detected murderers and detectives.",
"", "Statistics: .mm [stat]",
"Clear list(-s): .mm clear [all|m|d]");
}

@Override
public void call(String[] args) throws CmdException
{
if(args.length < 1)
{
stat();
return;
}

if(args.length > 2)
throw new CmdSyntaxError();

switch(args[0].toLowerCase())
{
case "":
case "stat":
stat();
break;

case "clear":
clear(args);
break;

default:
throw new CmdSyntaxError();
}
}

private void stat()
{
MurderMysteryHack mm = WURST.getHax().murderMysteryHack;
ChatUtils.message(mm.getMurderersCommaSeparatedEnumerationString());
ChatUtils.message(mm.getDetectivesCommaSeparatedEnumerationString());
}

private void clear(String[] args) throws CmdException
{
MurderMysteryHack mm = WURST.getHax().murderMysteryHack;

if(args.length < 2)
{
mm.clearMurderers();
mm.clearDetectives();
ChatUtils.message("Murderers and detectives lists are cleared");
return;
}

switch(args[1])
{
case "all":
mm.clearMurderers();
mm.clearDetectives();
ChatUtils.message("Murderers and detectives lists are cleared");
break;

case "m":
mm.clearMurderers();
ChatUtils.message("Murderers list is cleared");
break;

case "d":
mm.clearDetectives();
ChatUtils.message("Detectives list is cleared");
break;

default:
throw new CmdSyntaxError();
}
}
}
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hack/HackList.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public final class HackList implements UpdateListener
public final MobEspHack mobEspHack = new MobEspHack();
public final MobSpawnEspHack mobSpawnEspHack = new MobSpawnEspHack();
public final MultiAuraHack multiAuraHack = new MultiAuraHack();
public final MurderMysteryHack murderMysteryHack = new MurderMysteryHack();
public final NameProtectHack nameProtectHack = new NameProtectHack();
public final NameTagsHack nameTagsHack = new NameTagsHack();
public final NavigatorHack navigatorHack = new NavigatorHack();
Expand Down
Loading