From e657b3ebbf62341304c51ceebbdc468a12841b5a Mon Sep 17 00:00:00 2001 From: null Date: Tue, 6 Oct 2020 18:24:50 +0800 Subject: [PATCH 1/9] Create ncpAutoBlock.js --- combat/ncpAutoBlock.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 combat/ncpAutoBlock.js diff --git a/combat/ncpAutoBlock.js b/combat/ncpAutoBlock.js new file mode 100644 index 0000000..c199682 --- /dev/null +++ b/combat/ncpAutoBlock.js @@ -0,0 +1,20 @@ +///api_version=2 +//Copyright 2020 commandblock2 distributed under AGPL-3.0-or-later +(script = registerScript({ + name: "ncpBlock", + version: "1.0", + authors: ["commandblock2"] +})).import("Core.lib") + + +module = { + name: "ncpBlock", + description: "nothing new just a ncp block not even an auto one", + author: "commandblock2", + category: "Combat", + + onPacket: function (packetEvent) { + if (packetEvent.getPacket() instanceof C07PacketPlayerDigging) + packetEvent.cancelEvent() + } +} From afff0fbfa7ed5a2183bc61a04e25145e2836c3fb Mon Sep 17 00:00:00 2001 From: null Date: Sat, 14 Nov 2020 23:09:11 +0800 Subject: [PATCH 2/9] Update WTAPbot.js --- combat/WTAPbot.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/combat/WTAPbot.js b/combat/WTAPbot.js index 9b424f9..d2fe66a 100644 --- a/combat/WTAPbot.js +++ b/combat/WTAPbot.js @@ -7,6 +7,8 @@ authors: ["commandblock2"] })).import("Core.lib") +GameSettings = Java.type("net.minecraft.client.settings.GameSettings") + var countDownClicks = 5 var target = null @@ -18,7 +20,10 @@ var countDown = countDownClicks var lastFrameLeftDown = false var continue_ = true +var strafeLeft = true + var timer = new MSTimer() +var strafeTimer = new MSTimer() var forEach = Array.prototype.forEach; @@ -40,7 +45,9 @@ module = stopKey = value.createText("StopKey", "Z"), noBack = value.createBoolean("No S-Tap", true), aimMode = value.createList("AimMode", ["Predictive", "Face", "LegitLike"], "Predictive"), - singleAuraMode = value.createBoolean("FastComfirm", false) + singleAuraMode = value.createBoolean("FastComfirm", false), + adStrafe = value.createBoolean("AD-Strafe", true), + strafeInterval = value.createInteger("StrafeInterval", 500, 50, 2000) ], onRender3D: function () { @@ -72,6 +79,9 @@ module = sneak.get() && (mc.gameSettings.keyBindSneak.pressed = false); noBack.get() || (mc.gameSettings.keyBindBack.pressed = false); mc.gameSettings.keyBindForward.pressed = false; + + adStrafe.get() && (mc.gameSettings.keyBindLeft.pressed = false); + adStrafe.get() && (mc.gameSettings.keyBindRight.pressed = false); continue_ = true } } @@ -123,6 +133,33 @@ function setSprintState() { mc.gameSettings.keyBindForward.pressed = false } + if (adStrafe.get()) + if (strafeLeft){ + mc.gameSettings.keyBindLeft.pressed = true + mc.gameSettings.keyBindRight.pressed = false + } else{ + mc.gameSettings.keyBindLeft.pressed = false + mc.gameSettings.keyBindRight.pressed = true + } + + if (strafeTimer.hasTimePassed(strafeInterval.get())) { + strafeTimer.reset() + strafeLeft = !strafeLeft + } + + leftDown = Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()) + rightDown = Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()) + + if(rightDown) { + mc.gameSettings.keyBindRight.pressed = true + mc.gameSettings.keyBindLeft.pressed = false + } + + if (leftDown) { + mc.gameSettings.keyBindRight.pressed = false + mc.gameSettings.keyBindLeft.pressed = true + } + prevSprintState = comboSprint } From bee99a7dd60a68d05f1532130c486aef33f8324b Mon Sep 17 00:00:00 2001 From: null Date: Sat, 14 Nov 2020 23:14:54 +0800 Subject: [PATCH 3/9] Update WTAPbot.js --- combat/WTAPbot.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/combat/WTAPbot.js b/combat/WTAPbot.js index d2fe66a..96314f8 100644 --- a/combat/WTAPbot.js +++ b/combat/WTAPbot.js @@ -160,6 +160,11 @@ function setSprintState() { mc.gameSettings.keyBindLeft.pressed = true } + if (rightDown && leftDown) { + mc.gameSettings.keyBindLeft.pressed = true + mc.gameSettings.keyBindRight.pressed = true + } + prevSprintState = comboSprint } From 96445a95311f6e3f767e8f998f977ddf247588ae Mon Sep 17 00:00:00 2001 From: null Date: Sun, 24 Jan 2021 21:44:04 +0800 Subject: [PATCH 4/9] Create VectorizedXZVelocity.js --- combat/VectorizedXZVelocity.js | 90 ++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 combat/VectorizedXZVelocity.js diff --git a/combat/VectorizedXZVelocity.js b/combat/VectorizedXZVelocity.js new file mode 100644 index 0000000..bdccd3c --- /dev/null +++ b/combat/VectorizedXZVelocity.js @@ -0,0 +1,90 @@ +///api_version=2 +//Copyright 2020 commandblock2 distributed under AGPL-3.0-or-later +(script = registerScript({ + name: "VectorizedXZVelocity", + version: "1.0", + authors: ["commandblock2"] +})).import("Core.lib") + +GL11 = Java.type("org.lwjgl.opengl.GL11") +Color = Java.type("java.awt.Color") + +module = { + name: "VectorizedXZVelocity", + description: "not only can u adjust the amount of knock back but the direction", + author: "commandblock2", + category: "combat", + + values: [ + mode = value.createList("OffSetBasedOn", ["Player", "CommingVelocityPacket"], "CommingVelocityPacket"), + offset = value.createInteger("AngleOffset", 0, -180, 180), + amplifier = value.createFloat("Amplifier", 1, 0, 2), + render = value.createBoolean("RenderDirectionWPlayer", true) + ], + + onPacket: function (packetEvent) { + packet = packetEvent.getPacket() + if (packet instanceof S12PacketEntityVelocity + && mc.theWorld.getEntityByID(packet.getEntityID()) == mc.thePlayer) { + + yaw = 0 + + if (mode.get() == "Player") + yaw = -(mc.thePlayer.rotationYaw + offset.get() + 180) + else { + yaw = Math.atan2(packet.motionZ, packet.motionX) / Math.PI * 180 + offset.get() + + } + velocity = Math.sqrt(packet.motionX * packet.motionX + packet.motionZ * packet.motionZ) * amplifier.get() + + packet.motionX = velocity * Math.sin(yaw / 180 * Math.PI) + packet.motionZ = velocity * Math.cos(yaw / 180 * Math.PI) + } + }, + + onRender3D: function () { + if (mode.get() == "Player") { + yaw = -(mc.thePlayer.rotationYaw + offset.get() + 180) + + xOffset = Math.sin(yaw / 180 * Math.PI) * amplifier.get() + zOffset = Math.cos(yaw / 180 * Math.PI) * amplifier.get() + + x = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * mc.timer.renderPartialTicks + y = mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * mc.timer.renderPartialTicks + z = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * mc.timer.renderPartialTicks + + drawLine([new Vec3(x, y + 1, z), + new Vec3(x + xOffset, y + 1, z + zOffset)], new Color(86, 156, 214)) + } + } +} + +function drawLine(poses, color) { + GL11.glPushMatrix(); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glLineWidth(4) + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + mc.entityRenderer.disableLightmap(); + GL11.glBegin(GL11.GL_LINE_STRIP); + RenderUtils.glColor(color); + renderPosX = mc.getRenderManager().viewerPosX; + renderPosY = mc.getRenderManager().viewerPosY; + renderPosZ = mc.getRenderManager().viewerPosZ; + + poses.forEach(function (pos) { + GL11.glVertex3d(pos.xCoord - renderPosX, pos.yCoord - renderPosY, pos.zCoord - renderPosZ); + }) + + + GL11.glColor4d(1, 1, 1, 1); + GL11.glEnd(); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); +} From eae9d9beed25685bf9da98a3552b3de58376d44e Mon Sep 17 00:00:00 2001 From: null Date: Sun, 24 Jan 2021 22:12:46 +0800 Subject: [PATCH 5/9] Update VectorizedXZVelocity.js --- combat/VectorizedXZVelocity.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/combat/VectorizedXZVelocity.js b/combat/VectorizedXZVelocity.js index bdccd3c..66e3392 100644 --- a/combat/VectorizedXZVelocity.js +++ b/combat/VectorizedXZVelocity.js @@ -32,8 +32,8 @@ module = { if (mode.get() == "Player") yaw = -(mc.thePlayer.rotationYaw + offset.get() + 180) else { - yaw = Math.atan2(packet.motionZ, packet.motionX) / Math.PI * 180 + offset.get() - + yaw = (Math.atan2(packet.motionX, packet.motionZ) * 180 / Math.PI) + offset.get() + chat.print(yaw) } velocity = Math.sqrt(packet.motionX * packet.motionX + packet.motionZ * packet.motionZ) * amplifier.get() From ad00c5225271ff7ef62c5d362aadf171e65b1849 Mon Sep 17 00:00:00 2001 From: null Date: Sun, 24 Jan 2021 22:15:08 +0800 Subject: [PATCH 6/9] Update VectorizedXZVelocity.js --- combat/VectorizedXZVelocity.js | 1 - 1 file changed, 1 deletion(-) diff --git a/combat/VectorizedXZVelocity.js b/combat/VectorizedXZVelocity.js index 66e3392..0630c77 100644 --- a/combat/VectorizedXZVelocity.js +++ b/combat/VectorizedXZVelocity.js @@ -33,7 +33,6 @@ module = { yaw = -(mc.thePlayer.rotationYaw + offset.get() + 180) else { yaw = (Math.atan2(packet.motionX, packet.motionZ) * 180 / Math.PI) + offset.get() - chat.print(yaw) } velocity = Math.sqrt(packet.motionX * packet.motionX + packet.motionZ * packet.motionZ) * amplifier.get() From ce57bcf090a9e9f7fb588047026345f4613d514c Mon Sep 17 00:00:00 2001 From: null Date: Mon, 25 Jan 2021 04:08:32 +0800 Subject: [PATCH 7/9] Update Projectiles+.js --- misc/Projectiles+.js | 62 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/misc/Projectiles+.js b/misc/Projectiles+.js index 7a21644..c700ba9 100644 --- a/misc/Projectiles+.js +++ b/misc/Projectiles+.js @@ -19,9 +19,11 @@ Material = Java.type("net.minecraft.block.material.Material") entity2PositionHistorys = new HashMap() entity2PositionPredicition = new HashMap() playerPositionPrediction = [] -dodging = false +dodging = null +targetPos = null oIndex = -1 +oYaw = -1 module = { name: "ProjectilesPlus", @@ -29,10 +31,13 @@ module = { author: "commandblock2", category: "misc", values: [ - arrowDodge = value.createBoolean("ArrowDodge", true), + arrowDodge = value.createBoolean("ArrowDodge", true + +), + ticksToDodge = value.createInteger("TicksToDodge", 5, 1, 20), renderPlayerPrediction = value.createBoolean("RenderPlayerPrediction", false), - dodgeMode = value.createList("DodgeMode", ["TeleportUp", "BlockHit"], "BlockHit"), + dodgeMode = value.createList("DodgeMode", ["TeleportUp", "BlockHit", "HorizontalSpeed"], "BlockHit"), autoSwordBlockHit = value.createBoolean("AutoSword4BlockHit", true) ], @@ -71,7 +76,7 @@ module = { if (dodging) if (dodgeMode.get() == "TeleportUp") { mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 2, mc.thePlayer.posZ) - dodging = false + dodging = null } else if (dodgeMode.get() == "BlockHit") { if (autoSwordBlockHit.get()) @@ -85,6 +90,7 @@ module = { mc.gameSettings.keyBindUseItem.pressed = true + timeout(ticksToDodge.get() * 50, function () { if (!dodging) { mc.gameSettings.keyBindUseItem.pressed = false @@ -93,12 +99,46 @@ module = { oIndex = -1 } } - dodging = false + dodging = null + }) + } + else if (dodgeMode.get() == "HorizontalSpeed") { + if (-1 == oYaw) + oYaw = mc.thePlayer.rotationYaw + + + right = new Rotation(dodging - 90, mc.thePlayer.rotationPitch) + left = new Rotation(dodging + 90, mc.thePlayer.rotationPitch) + + rightYaw = right.yaw / 180 * Math.PI + leftYaw = left.yaw / 180 * Math.PI + + rightDis = mc.thePlayer.getPositionVector().add(RotationUtils.getVectorForRotation(right)).subtract(targetPos).lengthVector() + leftDis = mc.thePlayer.getPositionVector().add(RotationUtils.getVectorForRotation(left)).subtract(targetPos).lengthVector() + + rot = (rightDis > leftDis) ? right : left + + rot.toPlayer(mc.thePlayer) + SpeedModule.state = true + mc.gameSettings.keyBindForward.pressed = true + + timeout(ticksToDodge.get() * 50, function () { + if (!dodging) { + if (oYaw != -1) + new Rotation(oYaw, mc.thePlayer.rotationPitch).toPlayer(mc.thePlayer) + + SpeedModule.state = false + mc.gameSettings.keyBindForward.pressed = false + + oYaw = -1 + } + dodging = null }) } }, onRender3D: function (event) { + entity2PositionHistorys.forEach(function (entity) { //Draw the history line drawLine(entity2PositionHistorys[entity], new Color(255, 255, 0)) @@ -228,14 +268,18 @@ function predict(entityArrow) { playerBoundingBox = mc.thePlayer.getEntityBoundingBox().expand(0.3, 0.3, 0.3) index = poses.length > ticksToDodge.get() ? ticksToDodge.get() : poses.length pos = playerPositionPrediction[index] - if (playerBoundingBox.calculateIntercept(posBefore, posAfter) && poses.length <= ticksToDodge.get()) - dodging = true + if (playerBoundingBox.calculateIntercept(posBefore, posAfter) && poses.length <= ticksToDodge.get()) { + targetPos = posBefore + dodging = Math.atan2(motionZ, motionX) * 180 / Math.PI + 90 + } playerBoundingBox = playerBoundingBox.offset(pos.xCoord - mc.thePlayer.posX, pos.yCoord - mc.thePlayer.posY, pos.zCoord - mc.thePlayer.posZ) - if (playerBoundingBox.calculateIntercept(posBefore, posAfter) && poses.length <= ticksToDodge.get()) - dodging = true + if (playerBoundingBox.calculateIntercept(posBefore, posAfter) && poses.length <= ticksToDodge.get()) { + targetPos = posBefore + dodging = Math.atan2(motionZ, motionX) * 180 / Math.PI + 90 + } // motion thing x += motionX From 4876b5f8f7f7cd41914ef1289e3d4bba7fafe781 Mon Sep 17 00:00:00 2001 From: null Date: Thu, 28 Jan 2021 02:23:45 +0800 Subject: [PATCH 8/9] Update VanillaAura.js --- combat/VanillaAura.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/combat/VanillaAura.js b/combat/VanillaAura.js index 7cbb70a..9b9078d 100644 --- a/combat/VanillaAura.js +++ b/combat/VanillaAura.js @@ -6,7 +6,6 @@ authors: ["commandblock2"] })).import("Core.lib") - var isEnemy var canBlock module = @@ -17,6 +16,10 @@ module = category: "combat", onUpdate: function () { + + if (RandomUtils.nextFloat(0,1) > 0.8) + return + target = Java.from(mc.theWorld.loadedEntityList) .filter(function (e) { return isEnemy.invoke(KillAuraModule, e) }) .sort(function (lhs, rhs) { return mc.thePlayer.getDistanceToEntity(lhs) - mc.thePlayer.getDistanceToEntity(rhs) })[0] @@ -24,9 +27,9 @@ module = if(!target) return - if(mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) mc.getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)) + if(mc.thePlayer.getHeldItem() && mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) mc.getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)) mc.getNetHandler().addToSendQueue(new C02PacketUseEntity(target, C02PacketUseEntity.Action.ATTACK)) - if(mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) mc.getNetHandler().addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.getCurrentItem())) + if(mc.thePlayer.getHeldItem() && mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) mc.getNetHandler().addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.getCurrentItem())) }, onEnable: function () { From 64215c244d403a67cc37a2f84c1209d934fce9ba Mon Sep 17 00:00:00 2001 From: null Date: Mon, 1 Mar 2021 18:51:42 +0800 Subject: [PATCH 9/9] Update Projectiles+.js steaming pile of shit --- misc/Projectiles+.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/misc/Projectiles+.js b/misc/Projectiles+.js index c700ba9..109043b 100644 --- a/misc/Projectiles+.js +++ b/misc/Projectiles+.js @@ -37,7 +37,7 @@ module = { ticksToDodge = value.createInteger("TicksToDodge", 5, 1, 20), renderPlayerPrediction = value.createBoolean("RenderPlayerPrediction", false), - dodgeMode = value.createList("DodgeMode", ["TeleportUp", "BlockHit", "HorizontalSpeed"], "BlockHit"), + dodgeMode = value.createList("DodgeMode", ["TeleportUp", "BlockHit", "HorizontalSpeed", "HorizontalTp", "HorizontalMotion"], "BlockHit"), autoSwordBlockHit = value.createBoolean("AutoSword4BlockHit", true) ], @@ -102,11 +102,10 @@ module = { dodging = null }) } - else if (dodgeMode.get() == "HorizontalSpeed") { + else if (dodgeMode.get().indexOf("Horizontal") != -1) { if (-1 == oYaw) oYaw = mc.thePlayer.rotationYaw - right = new Rotation(dodging - 90, mc.thePlayer.rotationPitch) left = new Rotation(dodging + 90, mc.thePlayer.rotationPitch) @@ -118,6 +117,23 @@ module = { rot = (rightDis > leftDis) ? right : left + if (dodgeMode.get() == "HorizontalTp") { + mc.thePlayer.setPosition(mc.thePlayer.posX + Math.sin(Math.toRadians(rot.yaw)), + mc.thePlayer.posY, + mc.thePlayer.posZ + Math.cos(Math.toRadians(rot.yaw))) + + dodging = null + return + } + + if (dodgeMode.get() == "HorizontalMotion") { + mc.thePlayer.motionX = Math.sin(Math.toRadians(rot.yaw)) + mc.thePlayer.motionZ = Math.cos(Math.toRadians(rot.yaw)) + + dodging = null + return + } + rot.toPlayer(mc.thePlayer) SpeedModule.state = true mc.gameSettings.keyBindForward.pressed = true