Skip to content

Commit

Permalink
Add MassTPA settings to ignore errors and stop when accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Nov 16, 2023
1 parent ec542b0 commit 74eb1d5
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 15 deletions.
23 changes: 22 additions & 1 deletion src/main/java/net/wurstclient/hacks/MassTpaHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.DontSaveState;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.CheckboxSetting;
import net.wurstclient.settings.SliderSetting;
import net.wurstclient.settings.SliderSetting.ValueDisplay;
import net.wurstclient.settings.TextFieldSetting;
Expand All @@ -41,9 +42,21 @@ public final class MassTpaHack extends Hack
s -> s.length() < 64 && ALLOWED_COMMANDS.matcher(s).matches());

private final SliderSetting delay = new SliderSetting("Delay",
"The delay between each teleport request.", 20, 1, 200, 1,
"The delay between each teleportation request.", 20, 1, 200, 1,
ValueDisplay.INTEGER.withSuffix(" ticks").withLabel(1, "1 tick"));

private final CheckboxSetting ignoreErrors =
new CheckboxSetting("Ignore errors",
"Whether to ignore messages from the server telling you that the"
+ " teleportation command isn't valid or that you don't have"
+ " permission to use it.",
false);

private final CheckboxSetting stopWhenAccepted = new CheckboxSetting(
"Stop when accepted", "Whether to stop sending more teleportation"
+ " requests when someone accepts one of them.",
true);

private final Random random = new Random();
private final ArrayList<String> players = new ArrayList<>();

Expand All @@ -57,6 +70,8 @@ public MassTpaHack()
setCategory(Category.CHAT);
addSetting(commandSetting);
addSetting(delay);
addSetting(ignoreErrors);
addSetting(stopWhenAccepted);
}

@Override
Expand Down Expand Up @@ -133,6 +148,9 @@ public void onReceivedMessage(ChatInputEvent event)

if(message.contains("/help") || message.contains("permission"))
{
if(ignoreErrors.isChecked())
return;

event.cancel();
ChatUtils.error("This server doesn't have a "
+ command.toUpperCase() + " command.");
Expand All @@ -141,6 +159,9 @@ public void onReceivedMessage(ChatInputEvent event)
}else if(message.contains("accepted") && message.contains("request")
|| message.contains("akzeptiert") && message.contains("anfrage"))
{
if(!stopWhenAccepted.isChecked())
return;

event.cancel();
ChatUtils.message("Someone accepted your " + command.toUpperCase()
+ " request. Stopping.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/cs_cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "Vytvoří lektvar, který může zabít téměř cokoliv, včetně hráčů v kreativním režimu. Nefunguje na nemrtvé, protože jsou již mrtví.\n\nVyžaduje kreativní režim.",
"description.wurst.hack.liquids": "Umožňuje umístit bloky do kapalin.",
"description.wurst.hack.lsd": "Způsobuje halucinace.",
"description.wurst.hack.masstpa": "Odešle požadavek na TPA všem hráčům.\nZastaví, když někdo přijme.",
"description.wurst.hack.masstpa": "Odešle požadavek na TPA všem hráčům.",
"description.wurst.hack.mileycyrus": "Neustálé twerkování.",
"description.wurst.hack.mobesp": "Zvýrazní moby v okolí.",
"description.wurst.hack.mobspawnesp": "Zvýrazní oblasti, kde se mohou mobové objevovat.\n§ežlutá§r - mobové se mohou oběvovat v noci\n§cred§r - mobové se mohou oběvovat vždy",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"description.wurst.hack.killpotion": "Generiert einen Trank, der fast alles töten kann, sogar Spieler im Kreativmodus. Funktioniert nicht bei untoten Mobs, weil die nach der Spiellogik bereits tot sind.\n\nFunktioniert nur im Kreativmodus.",
"description.wurst.hack.liquids": "Ermöglicht dir, Blöcke direkt in bzw. an Flüssigkeiten zu platzieren.",
"description.wurst.hack.lsd": "Verursacht Halluzinationen.",
"description.wurst.hack.masstpa": "Sendet TPA-Requests an alle Spieler.\nHört auf, sobald jemand akzeptiert.",
"description.wurst.hack.masstpa": "Sendet TPA-Requests an alle Spieler.",
"description.wurst.hack.mileycyrus": "Lässt dich twerken.",
"description.wurst.hack.mobesp": "Markiert Mobs in deiner Umgebung.",
"description.wurst.hack.mobspawnesp": "Markiert Orte, an denen Mobs spawnen können.\n§eGelb§r - Mobs können nachts spawnen\n§cRot§r - Mobs können jederzeit spawnen",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"description.wurst.hack.killpotion": "Generates a potion that can kill almost anything, including players in Creative mode. Does not work on undead mobs, since they are already dead.\n\nRequires Creative mode.",
"description.wurst.hack.liquids": "Allows you to place blocks in liquids.",
"description.wurst.hack.lsd": "Causes hallucinations.",
"description.wurst.hack.masstpa": "Sends a TPA request to all players.\nStops if someone accepts.",
"description.wurst.hack.masstpa": "Sends a TPA request to all players.",
"description.wurst.hack.mileycyrus": "Makes you twerk.",
"description.wurst.hack.mobesp": "Highlights nearby mobs.",
"description.wurst.hack.mobspawnesp": "Highlights areas where mobs can spawn.\n§eyellow§r - mobs can spawn at night\n§cred§r - mobs can always spawn",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"description.wurst.hack.killpotion": "Génère une potion qui peut presque tout tuer, y compris les joueurs en mode Créatif. Ne fonctionne pas sur les monstres morts-vivants, car ils sont déjà morts.\n\nNécessite le mode Créatif.",
"description.wurst.hack.liquids": "Permet de placer des blocs dans des liquides.",
"description.wurst.hack.lsd": "Provoque des hallucinations.",
"description.wurst.hack.masstpa": "Envoie une requête TPA à tous les joueurs.\nS'arrête si quelqu'un accepte.",
"description.wurst.hack.masstpa": "Envoie une requête TPA à tous les joueurs.",
"description.wurst.hack.mileycyrus": "Vous fait twerker.",
"description.wurst.hack.mobesp": "Met en évidence les monstres à proximité.",
"description.wurst.hack.mobspawnesp": "Met en évidence les zones où les monstres peuvent apparaître.\n§ejaune§r - les monstres peuvent apparaître la nuit\n§crouge§r - les monstres peuvent toujours apparaître",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/it_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "Genera una pozione che può uccidere quasi tutto, inclusi i giocatori in modalità Creativa. Non funziona sui mob non morti, poiché sono già morti.\n\nRichiede la modalità Creativa.",
"description.wurst.hack.liquids": "Ti permette di piazzare blocchi nei liquidi.",
"description.wurst.hack.lsd": "Causa allucinazioni da LSD.",
"description.wurst.hack.masstpa": "Manda una richiesta di teletrasporto a tutti i giocatori.\nSi ferma se qualcuno accetta.",
"description.wurst.hack.masstpa": "Manda una richiesta di teletrasporto a tutti i giocatori.",
"description.wurst.hack.mileycyrus": "Ti fa twerkare.",
"description.wurst.hack.mobesp": "Evidenzia i mob vicini.",
"description.wurst.hack.mobspawnesp": "Evidenzia le aree dove i mob possono spawnare.\n§egiallo§r - I mob possono nascere durante la notte\n§crosso§r - i mob possono nascere sempre",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"description.wurst.hack.killpotion": "クリエイティブモードのプレイヤーを含む、ほぼすべての生き物を倒すことができるポーションを生成する。\nアンデッドのモブはすでに死んでいるため使用不可。\n\nクリエイティブモード必須。",
"description.wurst.hack.liquids": "水面に直接ブロックを設置できるようになる。",
"description.wurst.hack.lsd": "幻覚症状を引き起こす。",
"description.wurst.hack.masstpa": "すべてのプレイヤーにTPA(テレポート)リクエストを送信する。\n誰かに許可されると停止する。",
"description.wurst.hack.masstpa": "すべてのプレイヤーにTPA(テレポート)リクエストを送信する。",
"description.wurst.hack.mileycyrus": "腰振りダンスをする。",
"description.wurst.hack.mobesp": "付近のモブをハイライト表示する。",
"description.wurst.hack.mobspawnesp": "モブがスポーンする可能性のあるエリアをハイライト表示する。\n§e黄色§r - モブが夜にスポーンする可能性あり\n§c赤色§r - モブが常時スポーンする可能性あり",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/ko_kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"description.wurst.hack.killaura": "자동으로 주변의 개체를 공격합니다.",
"description.wurst.hack.liquids": "액체 안에 블록을 배치할 수 있게 해줍니다.",
"description.wurst.hack.lsd": "환각을 유발합니다.",
"description.wurst.hack.masstpa": "모든 플레이어에게 TPA 요청을 보냅니다.\n누군가 수락하면 멈춥니다.",
"description.wurst.hack.masstpa": "모든 플레이어에게 TPA 요청을 보냅니다.",
"description.wurst.hack.mileycyrus": "트월킹을 할 수 있게 해줍니다.",
"description.wurst.hack.mobesp": "주변의 몹을 강조합니다.",
"description.wurst.hack.multiaura": "여러 개체를 동시에 공격하는 더 빠른 Killaura입니다.",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/pl_pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "Generuje miksturę, która może zabić prawie wszystko, w tym graczy w trybie kreatywnym. Nie działa na nieumarłych mobach, ponieważ są już martwe.\n\nWymaga trybu kreatywnego.",
"description.wurst.hack.liquids": "Umożliwia umieszczanie bloków w płynach.",
"description.wurst.hack.lsd": "Powoduje halucynacje.",
"description.wurst.hack.masstpa": "Wysyła prośbę TPA do wszystkich graczy.\nPrzestaje, jeśli ktoś zaakceptuje.",
"description.wurst.hack.masstpa": "Wysyła prośbę TPA do wszystkich graczy.",
"description.wurst.hack.mileycyrus": "Sprawia, że twerkujesz.",
"description.wurst.hack.mobesp": "Podświetla pobliskie moby.",
"description.wurst.hack.mobspawnesp": "Podświetla obszary, w których moby mogą się odradzać.\n§eżółty§r - moby mogą odradzać się w nocy\n§cczerwony§r - moby mogą zawsze się odradzać",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/ro_ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"description.wurst.hack.killpotion": "Genereaza o potiune care poate ucide orice, inclusiv playerii in Creativ. Nu functioneaza pe mortaciuni, fiindca mortaciunile-s deja moarte.\n\nNecesita Creativ.",
"description.wurst.hack.liquids": "Iti permite sa pui block-uri in lichide.",
"description.wurst.hack.lsd": "Cauzeaza halucinatii.",
"description.wurst.hack.masstpa": "Trimite TPA request la toti playerii.\nSe opreste atunci cand cineva accepta.",
"description.wurst.hack.masstpa": "Trimite TPA request la toti playerii.",
"description.wurst.hack.mileycyrus": "Faci twerk.",
"description.wurst.hack.mobesp": "Contureaza mobii din apropiere.",
"description.wurst.hack.mobspawnesp": "Contureaza zonele in care mobii se pot spawna.\n§egalben§r - mobii se pot spawna noaptea\n§crosu§r - mobii se pot spawna mereu",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "Создает зелье которое убивает практически кого угодно, даже тех кто в креативе. Не работает на нежити потому что они и так мертвы лол.\n\nДля работы требуется креатив.",
"description.wurst.hack.liquids": "Позволяет ставить блоки прямо в жидкостях.",
"description.wurst.hack.lsd": "Провоцирует тяжелые галлюцинации.",
"description.wurst.hack.masstpa": "Отправляет запрос на телепортацию всем игрокам.\nОстанавливается если кто-то примет.",
"description.wurst.hack.masstpa": "Отправляет запрос на телепортацию всем игрокам.",
"description.wurst.hack.mileycyrus": "Заставляет Вас тверкать.",
"description.wurst.hack.mobesp": "Подсвечивает мобов неподалеку.",
"description.wurst.hack.mobspawnesp": "Показывает места в которых могут заспавниться мобы.\n§eжёлтым§r - мобы могут заспавниться ночью\n§cкрасным§r - мобы могут заспавниться когда угодно",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/uk_ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"description.wurst.hack.killpotion": "Створює зілля вбиває практично будь-кого, навіть тих хто в креативі. Не працює на нежиті, бо вони мертві лол.\n\nДля роботи потрібен креатив.",
"description.wurst.hack.liquids": "Дозволяє ставити блоки прямо на рідині.",
"description.wurst.hack.lsd": "Провокує тяжкі галюцинації.",
"description.wurst.hack.masstpa": "Надсилає запит на телепортацію всім гравцям.\nЗупиняється, якщо хтось прийме.",
"description.wurst.hack.masstpa": "Надсилає запит на телепортацію всім гравцям.",
"description.wurst.hack.mileycyrus": "Примушує вас тверкати.",
"description.wurst.hack.mobesp": "Підсвічує мобів знову.",
"description.wurst.hack.mobspawnesp": "Показує місця, у яких можуть народитися моби.\n§eжовтим§r - моби можуть народитися вночі\n§cчервоним§r - моби можуть народиться коли завгодно",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "生成一个能杀死绝大多数生物(包括创造模式的玩家)的药水,但对那些不死的生物或者已死生物无效。\n\n需要在创造模式下。",
"description.wurst.hack.liquids": "取消无法把方块直接放置在水中的限制,允许你直接在水方块中放置方块。",
"description.wurst.hack.lsd": "让你像吃了云南蘑菇一样。",
"description.wurst.hack.masstpa": "给每个人发送 TPA 请求。\n直到有人接受就会停止\n\n§c§l警告:§r当在国内服务器使用会因为 Wurst 无法判断中文返回消息而导致 TPA 请求继续。",
"description.wurst.hack.masstpa": "给每个人发送 TPA 请求。\n\n§c§l警告:§r当在国内服务器使用会因为 Wurst 无法判断中文返回消息而导致 TPA 请求继续。",
"description.wurst.hack.mileycyrus": "类似疯狂按 Shift 潜行。",
"description.wurst.hack.mobesp": "高亮附近的生物。",
"description.wurst.hack.mobspawnesp": "高亮生物可以生成的区域。\n§e黄色§r 可以在夜间生成\n§c红色§r - 可以在任意时候生成",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/zh_hk.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"description.wurst.hack.killpotion": "生成一個能殺死絕大多數生物嘅葯水,包括創造模式嘅玩家,但對唔死嘅生物抑或已死生物無效。\n\n需要喺創造模式下。",
"description.wurst.hack.liquids": "解除限制,允許你喺水中直接放置方塊。",
"description.wurst.hack.lsd": "產生食咗雲南蘑菇一樣嘅效果。",
"description.wurst.hack.masstpa": "畀每個人發送 傳送申請。\n直到有人接受就會停止\n\n§c§l警告:§r中文伺服器使用會因為 Wurst 判斷嘅係英文而導致 傳送申請 仍喺繼續。",
"description.wurst.hack.masstpa": "畀每個人發送 傳送申請。\n\n§c§l警告:§r中文伺服器使用會因為 Wurst 判斷嘅係英文而導致 傳送申請 仍喺繼續。",
"description.wurst.hack.mileycyrus": "類似瘋狂按 Shift 潛行。",
"description.wurst.hack.mobesp": "高亮附近嘅生物。",
"description.wurst.hack.mobspawnesp": "高亮生物可以生成嘅區域。\n§e黃色§r 可以喺夜間生成\n§c紅色§r - 可以喺任意時候生成",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wurst/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"description.wurst.hack.killpotion": "生成一個能殺死絕大多數生物的藥水,包括創造模式的玩家,但對那些不死的生物或者已死生物無效。\n\n需要在創造模式下。",
"description.wurst.hack.liquids": "取消限制,允許你在水面上直接放置方塊。",
"description.wurst.hack.lsd": "產生和吃了雲南蘑菇一樣的漸變色暈眩效果。",
"description.wurst.hack.masstpa": "給每個人發送TPA請求。\n直到有人接受就會停止\n\n§c§l警告:§r國內服務器使用會因為Wurst判斷的是英文而導致TPA仍在繼續。",
"description.wurst.hack.masstpa": "給每個人發送TPA請求。\n\n§c§l警告:§r國內服務器使用會因為Wurst判斷的是英文而導致TPA仍在繼續。",
"description.wurst.hack.mileycyrus": "類似全自動Shift蹲起。",
"description.wurst.hack.mobesp": "高亮附近的生物。",
"description.wurst.hack.mobspawnesp": "高亮那些生物可以生成的區域。\n§e黃色§r - 可以在夜間生成\n§c紅色§r - 可以在任意時候生成",
Expand Down

0 comments on commit 74eb1d5

Please sign in to comment.