Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. Kotlin/Java
  3. [Kotlin] TargetStrafe with circle

[Kotlin] TargetStrafe with circle

Scheduled Pinned Locked Moved Kotlin/Java
9 Posts 5 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • BobikHatarB Offline
    BobikHatarB Offline
    BobikHatar
    wrote on last edited by BobikHatar
    #1

    sexy targetstrafe with sexy circle wow
    .killaura strafe silent

    package net.ccbluex.liquidbounce.features.module.modules.movement
    
    import net.ccbluex.liquidbounce.LiquidBounce
    import net.ccbluex.liquidbounce.event.EventTarget
    import net.ccbluex.liquidbounce.event.MoveEvent
    import net.ccbluex.liquidbounce.event.Render3DEvent
    import net.ccbluex.liquidbounce.features.module.Module
    import net.ccbluex.liquidbounce.features.module.ModuleCategory
    import net.ccbluex.liquidbounce.features.module.ModuleInfo
    import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura
    import net.ccbluex.liquidbounce.utils.RotationUtils
    import net.ccbluex.liquidbounce.value.BoolValue
    import net.ccbluex.liquidbounce.value.FloatValue
    import net.ccbluex.liquidbounce.value.ListValue
    import net.minecraft.entity.Entity
    import net.minecraft.util.AxisAlignedBB
    import org.lwjgl.opengl.GL11
    import java.awt.Color
    import kotlin.math.cos
    import kotlin.math.sin
    
    
    @ModuleInfo(name = "TargetStrafe", description = "TargetStrafe", category = ModuleCategory.MOVEMENT)
    class TargetStrafe : Module() {
    
        private val render = BoolValue("Render", true)
        private val radiusValue = FloatValue("radius", 0.5f, 0.1f, 5.0f)
        private val modeValue = ListValue("KeyMode", arrayOf("Jump", "None"), "None")
        private val radiusMode = ListValue("radiusMode", arrayOf("TrueRadius", "Simple"), "Simple")
        private val killAura = LiquidBounce.moduleManager.getModule(KillAura::class.java) as KillAura
        private val speed = LiquidBounce.moduleManager.getModule(Speed::class.java) as Speed
        private val fly = LiquidBounce.moduleManager.getModule(Fly::class.java) as Fly
    
        var consts = 0
        var lastDist = 0.0
    
        fun onMove(event: MoveEvent) {
            val xDist = event.x
            val zDist = event.z
            lastDist = Math.sqrt(xDist * xDist + zDist * zDist)
        }
        @EventTarget
        fun movestrafe(event: MoveEvent) {
            onMove(event)
    
            if (!isVoid(0, 0) && canStrafe) {
                val strafe = RotationUtils.getRotations(killAura.target)
                setSpeed(event, lastDist, strafe.yaw, radiusValue.get(), 1.0)
            }
    
        }
    
        val keyMode: Boolean
            get() = when (modeValue.get().toLowerCase()) {
                "jump" -> mc.gameSettings.keyBindJump.isKeyDown
                "none" -> mc.thePlayer.movementInput.moveStrafe == 0f || mc.thePlayer.movementInput.moveForward == 0f
                else -> false
            }
    
        val canStrafe: Boolean
            get() = (killAura.state && (speed.state || fly.state) && killAura.target != null && !mc.thePlayer.isSneaking
                    && keyMode)
    
        val cansize: Float
            get() = when {
                radiusMode.get().toLowerCase() == "simple" ->
                    45f / mc.thePlayer.getDistance(killAura.target!!.posX, mc.thePlayer.posY, killAura.target!!.posZ).toFloat()
                else -> 45f
            }
        val Enemydistance: Double
            get() = mc.thePlayer.getDistance(killAura.target!!.posX, mc.thePlayer.posY, killAura.target!!.posZ)
    
        val algorithm: Float
            get() = Math.max(Enemydistance - radiusValue.get(), Enemydistance - (Enemydistance - radiusValue.get() / (radiusValue.get() * 2))).toFloat()
    
    
    
        fun setSpeed(
            moveEvent: MoveEvent, moveSpeed: Double, pseudoYaw: Float, pseudoStrafe: Float,
            pseudoForward: Double
        ) {
            var yaw = pseudoYaw
            var forward = pseudoForward
            var strafe = pseudoStrafe
            var strafe2 = 0f
    
            check()
    
            when {
                modeValue.get().toLowerCase().equals("jump") ->
                    strafe = (pseudoStrafe * 0.98 * consts).toFloat()
                modeValue.get().toLowerCase().equals("none") ->
                    strafe = consts.toFloat()
            }
    
            if (forward != 0.0) {
                if (strafe > 0.0) {
                    if (radiusMode.get().toLowerCase() == "trueradius")
                        yaw += (if (forward > 0.0) -cansize else cansize)
                    strafe2 += (if (forward > 0.0) -45 / algorithm else 45 / algorithm)
                } else if (strafe < 0.0) {
                    if (radiusMode.get().toLowerCase() == "trueradius")
                        yaw += (if (forward > 0.0) cansize else -cansize)
                    strafe2 += (if (forward > 0.0) 45 / algorithm else -45 / algorithm)
                }
                strafe = 0.0f
                if (forward > 0.0)
                    forward = 1.0
                else if (forward < 0.0)
                    forward = -1.0
    
            }
            if (strafe > 0.0)
                strafe = 1.0f
            else if (strafe < 0.0)
                strafe = -1.0f
    
    
            val mx = Math.cos(Math.toRadians(yaw + 90.0 + strafe2))
            val mz = Math.sin(Math.toRadians(yaw + 90.0 + strafe2))
            moveEvent.x = forward * moveSpeed * mx + strafe * moveSpeed * mz
            moveEvent.z = forward * moveSpeed * mz - strafe * moveSpeed * mx
        }
    
        private fun check() {
            if (mc.thePlayer.isCollidedHorizontally || checkVoid()) {
                if (consts < 2) consts += 1
                else {
                    consts = -1
                }
            }
            when (consts) {
                0 -> {
                    consts = 1
                }
                2 -> {
                    consts = -1
                }
            }
        }
    
        private fun checkVoid(): Boolean {
            for (x in -1..0) {
                for (z in -1..0) {
                    if (isVoid(x, z)) {
                        return true
                    }
                }
            }
            return false
        }
    
    
        private fun isVoid(X: Int, Z: Int): Boolean {
            val fly = LiquidBounce.moduleManager.getModule(Fly::class.java) as Fly
            if (fly.state) {
                return false
            }
            if (mc.thePlayer.posY < 0.0) {
                return true
            }
            var off = 0
            while (off < mc.thePlayer.posY.toInt() + 2) {
                val bb: AxisAlignedBB = mc.thePlayer.entityBoundingBox.offset(X.toDouble(), (-off).toDouble(), Z.toDouble())
                if (mc.theWorld!!.getCollidingBoundingBoxes(mc.thePlayer as Entity, bb).isEmpty()) {
                    off += 2
                    continue
                }
                return false
                off += 2
            }
            return true
        }
    
        @EventTarget
        fun onRender3D(event: Render3DEvent) {
            val target = (LiquidBounce.moduleManager[KillAura::class.java] as KillAura).target
            if (render.get()) {
                target?:return
                GL11.glPushMatrix()
                GL11.glDisable(3553)
                GL11.glEnable(2848)
                GL11.glEnable(2881)
                GL11.glEnable(2832)
                GL11.glEnable(3042)
                GL11.glBlendFunc(770, 771)
                GL11.glHint(3154, 4354)
                GL11.glHint(3155, 4354)
                GL11.glHint(3153, 4354)
                GL11.glDisable(2929)
                GL11.glDepthMask(false)
                GL11.glLineWidth(5.0f)
    
                GL11.glBegin(3)
                val x = target.lastTickPosX + (target.posX - target.lastTickPosX) * event.partialTicks - mc.renderManager.viewerPosX
                val y = target.lastTickPosY + (target.posY - target.lastTickPosY) * event.partialTicks - mc.renderManager.viewerPosY
                val z = target.lastTickPosZ + (target.posZ - target.lastTickPosZ) * event.partialTicks - mc.renderManager.viewerPosZ
                for (i in 0..360) {
                    GL11.glColor3f( 200.0f, 0.0f,   0.0f)
                    GL11.glVertex3d(x + radiusValue.get() * cos(i.toDouble() * 6.283185307179586 /13), y, z + radiusValue.get()* sin(i.toDouble() * 6.283185307179586 / 13.0))
                }
                GL11.glEnd()
    
                GL11.glDepthMask(true)
                GL11.glEnable(2929)
                GL11.glDisable(2848)
                GL11.glDisable(2881)
                GL11.glEnable(2832)
                GL11.glEnable(3553)
                GL11.glPopMatrix()
            }
        }
    
    }
    
    ? 1 Reply Last reply
    0
    • BobikHatarB BobikHatar

      sexy targetstrafe with sexy circle wow
      .killaura strafe silent

      package net.ccbluex.liquidbounce.features.module.modules.movement
      
      import net.ccbluex.liquidbounce.LiquidBounce
      import net.ccbluex.liquidbounce.event.EventTarget
      import net.ccbluex.liquidbounce.event.MoveEvent
      import net.ccbluex.liquidbounce.event.Render3DEvent
      import net.ccbluex.liquidbounce.features.module.Module
      import net.ccbluex.liquidbounce.features.module.ModuleCategory
      import net.ccbluex.liquidbounce.features.module.ModuleInfo
      import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura
      import net.ccbluex.liquidbounce.utils.RotationUtils
      import net.ccbluex.liquidbounce.value.BoolValue
      import net.ccbluex.liquidbounce.value.FloatValue
      import net.ccbluex.liquidbounce.value.ListValue
      import net.minecraft.entity.Entity
      import net.minecraft.util.AxisAlignedBB
      import org.lwjgl.opengl.GL11
      import java.awt.Color
      import kotlin.math.cos
      import kotlin.math.sin
      
      
      @ModuleInfo(name = "TargetStrafe", description = "TargetStrafe", category = ModuleCategory.MOVEMENT)
      class TargetStrafe : Module() {
      
          private val render = BoolValue("Render", true)
          private val radiusValue = FloatValue("radius", 0.5f, 0.1f, 5.0f)
          private val modeValue = ListValue("KeyMode", arrayOf("Jump", "None"), "None")
          private val radiusMode = ListValue("radiusMode", arrayOf("TrueRadius", "Simple"), "Simple")
          private val killAura = LiquidBounce.moduleManager.getModule(KillAura::class.java) as KillAura
          private val speed = LiquidBounce.moduleManager.getModule(Speed::class.java) as Speed
          private val fly = LiquidBounce.moduleManager.getModule(Fly::class.java) as Fly
      
          var consts = 0
          var lastDist = 0.0
      
          fun onMove(event: MoveEvent) {
              val xDist = event.x
              val zDist = event.z
              lastDist = Math.sqrt(xDist * xDist + zDist * zDist)
          }
          @EventTarget
          fun movestrafe(event: MoveEvent) {
              onMove(event)
      
              if (!isVoid(0, 0) && canStrafe) {
                  val strafe = RotationUtils.getRotations(killAura.target)
                  setSpeed(event, lastDist, strafe.yaw, radiusValue.get(), 1.0)
              }
      
          }
      
          val keyMode: Boolean
              get() = when (modeValue.get().toLowerCase()) {
                  "jump" -> mc.gameSettings.keyBindJump.isKeyDown
                  "none" -> mc.thePlayer.movementInput.moveStrafe == 0f || mc.thePlayer.movementInput.moveForward == 0f
                  else -> false
              }
      
          val canStrafe: Boolean
              get() = (killAura.state && (speed.state || fly.state) && killAura.target != null && !mc.thePlayer.isSneaking
                      && keyMode)
      
          val cansize: Float
              get() = when {
                  radiusMode.get().toLowerCase() == "simple" ->
                      45f / mc.thePlayer.getDistance(killAura.target!!.posX, mc.thePlayer.posY, killAura.target!!.posZ).toFloat()
                  else -> 45f
              }
          val Enemydistance: Double
              get() = mc.thePlayer.getDistance(killAura.target!!.posX, mc.thePlayer.posY, killAura.target!!.posZ)
      
          val algorithm: Float
              get() = Math.max(Enemydistance - radiusValue.get(), Enemydistance - (Enemydistance - radiusValue.get() / (radiusValue.get() * 2))).toFloat()
      
      
      
          fun setSpeed(
              moveEvent: MoveEvent, moveSpeed: Double, pseudoYaw: Float, pseudoStrafe: Float,
              pseudoForward: Double
          ) {
              var yaw = pseudoYaw
              var forward = pseudoForward
              var strafe = pseudoStrafe
              var strafe2 = 0f
      
              check()
      
              when {
                  modeValue.get().toLowerCase().equals("jump") ->
                      strafe = (pseudoStrafe * 0.98 * consts).toFloat()
                  modeValue.get().toLowerCase().equals("none") ->
                      strafe = consts.toFloat()
              }
      
              if (forward != 0.0) {
                  if (strafe > 0.0) {
                      if (radiusMode.get().toLowerCase() == "trueradius")
                          yaw += (if (forward > 0.0) -cansize else cansize)
                      strafe2 += (if (forward > 0.0) -45 / algorithm else 45 / algorithm)
                  } else if (strafe < 0.0) {
                      if (radiusMode.get().toLowerCase() == "trueradius")
                          yaw += (if (forward > 0.0) cansize else -cansize)
                      strafe2 += (if (forward > 0.0) 45 / algorithm else -45 / algorithm)
                  }
                  strafe = 0.0f
                  if (forward > 0.0)
                      forward = 1.0
                  else if (forward < 0.0)
                      forward = -1.0
      
              }
              if (strafe > 0.0)
                  strafe = 1.0f
              else if (strafe < 0.0)
                  strafe = -1.0f
      
      
              val mx = Math.cos(Math.toRadians(yaw + 90.0 + strafe2))
              val mz = Math.sin(Math.toRadians(yaw + 90.0 + strafe2))
              moveEvent.x = forward * moveSpeed * mx + strafe * moveSpeed * mz
              moveEvent.z = forward * moveSpeed * mz - strafe * moveSpeed * mx
          }
      
          private fun check() {
              if (mc.thePlayer.isCollidedHorizontally || checkVoid()) {
                  if (consts < 2) consts += 1
                  else {
                      consts = -1
                  }
              }
              when (consts) {
                  0 -> {
                      consts = 1
                  }
                  2 -> {
                      consts = -1
                  }
              }
          }
      
          private fun checkVoid(): Boolean {
              for (x in -1..0) {
                  for (z in -1..0) {
                      if (isVoid(x, z)) {
                          return true
                      }
                  }
              }
              return false
          }
      
      
          private fun isVoid(X: Int, Z: Int): Boolean {
              val fly = LiquidBounce.moduleManager.getModule(Fly::class.java) as Fly
              if (fly.state) {
                  return false
              }
              if (mc.thePlayer.posY < 0.0) {
                  return true
              }
              var off = 0
              while (off < mc.thePlayer.posY.toInt() + 2) {
                  val bb: AxisAlignedBB = mc.thePlayer.entityBoundingBox.offset(X.toDouble(), (-off).toDouble(), Z.toDouble())
                  if (mc.theWorld!!.getCollidingBoundingBoxes(mc.thePlayer as Entity, bb).isEmpty()) {
                      off += 2
                      continue
                  }
                  return false
                  off += 2
              }
              return true
          }
      
          @EventTarget
          fun onRender3D(event: Render3DEvent) {
              val target = (LiquidBounce.moduleManager[KillAura::class.java] as KillAura).target
              if (render.get()) {
                  target?:return
                  GL11.glPushMatrix()
                  GL11.glDisable(3553)
                  GL11.glEnable(2848)
                  GL11.glEnable(2881)
                  GL11.glEnable(2832)
                  GL11.glEnable(3042)
                  GL11.glBlendFunc(770, 771)
                  GL11.glHint(3154, 4354)
                  GL11.glHint(3155, 4354)
                  GL11.glHint(3153, 4354)
                  GL11.glDisable(2929)
                  GL11.glDepthMask(false)
                  GL11.glLineWidth(5.0f)
      
                  GL11.glBegin(3)
                  val x = target.lastTickPosX + (target.posX - target.lastTickPosX) * event.partialTicks - mc.renderManager.viewerPosX
                  val y = target.lastTickPosY + (target.posY - target.lastTickPosY) * event.partialTicks - mc.renderManager.viewerPosY
                  val z = target.lastTickPosZ + (target.posZ - target.lastTickPosZ) * event.partialTicks - mc.renderManager.viewerPosZ
                  for (i in 0..360) {
                      GL11.glColor3f( 200.0f, 0.0f,   0.0f)
                      GL11.glVertex3d(x + radiusValue.get() * cos(i.toDouble() * 6.283185307179586 /13), y, z + radiusValue.get()* sin(i.toDouble() * 6.283185307179586 / 13.0))
                  }
                  GL11.glEnd()
      
                  GL11.glDepthMask(true)
                  GL11.glEnable(2929)
                  GL11.glDisable(2848)
                  GL11.glDisable(2881)
                  GL11.glEnable(2832)
                  GL11.glEnable(3553)
                  GL11.glPopMatrix()
              }
          }
      
      }
      
      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @божественная-кара is it yours? holy smokes dude how did you code that

      BobikHatarB 1 Reply Last reply
      0
      • ? A Former User

        @божественная-кара is it yours? holy smokes dude how did you code that

        BobikHatarB Offline
        BobikHatarB Offline
        BobikHatar
        wrote on last edited by
        #3

        @mems lol yesyes its my

        Plumer ManP 1 Reply Last reply
        0
        • BobikHatarB BobikHatar

          @mems lol yesyes its my

          Plumer ManP Offline
          Plumer ManP Offline
          Plumer Man
          wrote on last edited by Plumer Man
          #4

          @божественная-кара 100% no copy + paste

          https://github.com/Project-EZ4H/FDPClient/blob/master/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TargetStrafe.kt

          c8de1e7d-ff2e-4407-92d2-dbfdfa073a71-image.png

          2b649a36-a100-4b20-beb3-50888d520fe7-image.png

          BobikHatarB 1 Reply Last reply
          0
          • Plumer ManP Plumer Man

            @божественная-кара 100% no copy + paste

            https://github.com/Project-EZ4H/FDPClient/blob/master/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TargetStrafe.kt

            c8de1e7d-ff2e-4407-92d2-dbfdfa073a71-image.png

            2b649a36-a100-4b20-beb3-50888d520fe7-image.png

            BobikHatarB Offline
            BobikHatarB Offline
            BobikHatar
            wrote on last edited by
            #5

            @plumer-man https://en.wikipedia.org/wiki/Joke

            Plumer ManP 6Sence6 2 Replies Last reply
            0
            • BobikHatarB BobikHatar

              @plumer-man https://en.wikipedia.org/wiki/Joke

              Plumer ManP Offline
              Plumer ManP Offline
              Plumer Man
              wrote on last edited by
              #6

              @божественная-кара https://en.wikipedia.org/wiki/I_Know

              1 Reply Last reply
              0
              • BobikHatarB Offline
                BobikHatarB Offline
                BobikHatar
                wrote on last edited by
                #7

                @plumer-man https://en.wikipedia.org/wiki/OK

                1 Reply Last reply
                0
                • BobikHatarB BobikHatar

                  @plumer-man https://en.wikipedia.org/wiki/Joke

                  6Sence6 Offline
                  6Sence6 Offline
                  6Sence
                  wrote on last edited by
                  #8

                  @божественная-кара its not funny

                  BobikHatarB 1 Reply Last reply
                  0
                  • 6Sence6 6Sence

                    @божественная-кара its not funny

                    BobikHatarB Offline
                    BobikHatarB Offline
                    BobikHatar
                    wrote on last edited by
                    #9

                    its sad 😞

                    1 Reply Last reply
                    1

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    About
                    • Terms of Service
                    • Privacy Policy
                    • Status
                    • Contact Us
                    Downloads
                    • Releases
                    • Source code
                    • License
                    Docs
                    • Tutorials
                    • CustomHUD
                    • AutoSettings
                    • ScriptAPI
                    Community
                    • Forum
                    • Guilded
                    • YouTube
                    • Twitter
                    • D.Tube
                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups