TextEditor V1(By Mumy)(JS can be made in the game)
-
Currently this JS is in the testing phase
var scriptName = "TextEditor"; var scriptVersion = 1.0; var scriptAuthor = "mumy++"; var TextEditor = new TextEditor(); var client; var NoSlow = moduleManager.getModule("NoSlow"); var fly = moduleManager.getModule("Fly"); var KillAuraModule = moduleManager.getModule("KillAura"); var KillAuraClass = Java.type("net.ccbluex.liquidbounce.LiquidBounce").moduleManager.getModule(Java.type("net.ccbluex.liquidbounce.features.module.modules.combat.KillAura").class); var KillAura = Java.type('net.ccbluex.liquidbounce.features.module.modules.combat.KillAura'); var EnumFacing = Java.type('net.minecraft.util.EnumFacing'); var BlockPos = Java.type('net.minecraft.util.BlockPos'); var EventState = Java.type('net.ccbluex.liquidbounce.event.EventState'); var C02PacketUseEntity = Java.type('net.minecraft.network.play.client.C02PacketUseEntity'); var C0APacketAnimation = Java.type('net.minecraft.network.play.client.C0APacketAnimation'); var C09PacketHeldItemChange = Java.type('net.minecraft.network.play.client.C09PacketHeldItemChange'); var C08PacketPlayerBlockPlacement = Java.type('net.minecraft.network.play.client.C08PacketPlayerBlockPlacement'); var C07PacketPlayerDigging = Java.type('net.minecraft.network.play.client.C07PacketPlayerDigging'); var C06PlayerPacketPosLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook'); var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition'); var C05PacketPlayerLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook'); var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer'); var S08PacketPlayerPosLook = Java.type('net.minecraft.network.play.server.S08PacketPlayerPosLook'); var S02PacketChat = Java.type('net.minecraft.network.play.server.S02PacketChat'); var C01PacketChatMessage = Java.type('net.minecraft.network.play.client.C01PacketChatMessage'); var RandomUtils = Java.type('net.ccbluex.liquidbounce.utils.misc.RandomUtils'); var MovementUtils = Java.type('net.ccbluex.liquidbounce.utils.MovementUtils'); var RotationUtils = Java.type('net.ccbluex.liquidbounce.utils.RotationUtils'); var ItemSword = Java.type('net.minecraft.item.ItemSword'); var ItemBow = Java.type('net.minecraft.item.ItemBow'); var ItemFood = Java.type('net.minecraft.item.ItemFood'); var ItemPotion = Java.type('net.minecraft.item.ItemPotion'); var ItemBucketMilk = Java.type('net.minecraft.item.ItemBucketMilk'); var File = Java.type("java.io.File"); var FileReader = Java.type("java.io.FileReader"); var FileWriter = Java.type("java.io.FileWriter"); var BufferedReader = Java.type("java.io.BufferedReader"); var BufferedWriter = Java.type("java.io.BufferedWriter"); var Integer = Java.type("java.lang.Integer"); function TextEditor() { var ModuleString = '§8[§9' + 'TextEditor' + '§8] §3'; var update, list = [], state = 0, pstate = 0, string = "", message = "", writer = null; var p, age = []; var line = 1, maxLine = 0; var Values = []; this.getName = function() { return "TextEditor"; }; this.getDescription = function() { return "TextEditor-Module,By-mumy."; }; this.getCategory = function() { return "Misc"; }; /*this.getTag = function() { return ""; };*/ this.onEnable = function() { line = maxLine = 1; pstate = state = 0; writer = null; run(); } function None() { } this.onAttack = function(event) { //target = event.getTargetEntity(); } this.onWorld = function(event) { } this.onUpdate = function() { if (update) { update = false; run(); for (var i = 0; i < age.length; ++i) { if (p == age[i]) { continue; } chat.print((p = age[i])); } age = []; //chat.print(state); } } this.onMotion = function(event) { } function run() { switch (state) { case 0: println("Dir:"); break; case 1: try { var file = new File(message); var reader = new BufferedReader(new FileReader(file)); var l = ""; while ((l = reader.readLine()) !== null) { list.push(l + "\n"); } } catch (err) {} maxLine = list.length; writer = new FileWriter(message); var str_ = ""; for (var i = 0; i < Math.min(list.length, maxLine); ++i) { str_ += get_String(list[i]); } writer.write(str_); state++; run(); break; case 2: println("Line §8" + line + "§3> \"" + get__String(list.length < line ? "" : list[line - 1]) + "\" "); break; default: try { var str = message; if (isSetLine(str)) { maxLine = line = getNumber(str); state = 2; return run(); } if (isDeleteLine(str)) { deleteLine(str); state = 2; return run(); } if (str.toLowerCase() == "-out") { chat.print(ModuleString + ">"); var str_ = ""; for (var i = 0; i < Math.min(list.length, maxLine); ++i) { str_ += get_String(list[i]); chat.print(" §8" + get___String(get_String(list[i]))); } state = 255; try { writer.write(str_); writer.flush(); } catch (err) { chat.print("[Err!]"); } finally { list = []; writer.close(); return Module("TextEditor", false); } } while (list.length < line) { list.push("\n"); } //setList(line - 1, ((str.toLowerCase().contains("//over") || str.toLowerCase().contains("//overwrite")) || list.get(line - 1).equalsIgnoreCase("\n") ? str : (str.toLowerCase().contains("//prevadd") ? str + get__String(list.get(line - 1)) : get__String(list.get(line - 1)) + str)) + "\n"); setList(line - 1, (str.toLowerCase().indexOf("/*add*/") != -1 || str.toLowerCase().indexOf("/*prevadd*/") != -1 ? str.toLowerCase().indexOf("/*prevadd*/") != -1 ? str + get__String(list[line - 1]) : get__String(list[line - 1]) + str : str) + "\n"); maxLine = Math.max(maxLine, ++line); } catch (err) { } finally { state = 2; run(); } break; } } function get_String(str) { var ns = ""; for (var i = 0; i < str.length; ++i) { if (i < str.length - 1 && str[i] == "\\" && isNumber(str[i + 1])) { for (var c = 0; c < getNumber(str[i + 1]); ++c) { ns += " "; } ++i; } else { ns += str[i]; } } return ns; } function get__String(str) { var ns = ""; for (var i = 0; i < str.length; ++i) { if (str[i] == "\n" && i == str.length - 1) { continue; } ns += str[i]; } return ns; } function get___String(str) { var ns = ""; for (var i = 0; i < str.length - 1; ++i) { ns += str[i]; } return ns; } function setList(index, str) { list[index] = str; } function isSetLine(str) { if (str.length < 6) { return false; } return str[0] == "-" && str.toLowerCase().indexOf("line") != -1; } function isDeleteLine(str) { if (str.length < 10) { return false; } return str[0] == "-" && str.toLowerCase().indexOf("delete") != -1 && str.indexOf(",") != -1; } function deleteLine(str) { var a = getNumber(str), b, c = 0; var bs = ""; for (var i = 0; i < str.length; ++i) { if (c != 0) { bs += str[i]; } if (str[i] == ",") { c = 1; } } b = getNumber(bs); for (var i = 0; i < list.length; ++i) { if (i > a - 2 && i < b) { setList(i, "\n"); } } } function getNumber(str) { var v = "", ns = ""; for (var i = 0; i < str.length; ++i) { v = str[i]; if (v == ",") { break; } if (isNumber(v)) { ns += v; } } return Integer.parseInt(ns); } function isNumber(str) { switch (str) { case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": return true; } return false; } this.onSlowDown = function(event) { } this.onPacket = function(event) { var packet = event.getPacket(); if (packet instanceof C01PacketChatMessage) { event.cancelEvent(); if (!update) { age.push("§8 " + (message = packet.getMessage())); state++; update = true; } } } function println(str) { age.push(ModuleString + str); } function Module(module, state) { state != null ? Module(module).setState(state) : null; return moduleManager.getModule(module); } this.addValues = function(values) { for (var v in Values) { values.add(Values[v]); } } this.onDisable = function() { //this.onEnable(); state = 0; update = false; } } function onLoad() {} function onEnable() { client = moduleManager.registerModule(TextEditor); } function onDisable() { moduleManager.unregisterModule(client); }
-
okay so my other post got deleted so here it is again
dont see any rule violation, thank you based bouncerdevs, but to elaborate further- horrendous code formatting
- some of the func defs are just unused
- the execution itself is bad as why would you ever try editing anything via the minecraft chat