From 7df0e61f92ca753207bf8c70ac4ff1d0c05b4422 Mon Sep 17 00:00:00 2001 From: nickcat325 <80810636+nickcat325@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:20:25 -0500 Subject: [PATCH 1/6] Baritone.kt Darft --- .../client/module/modules/client/Baritone.kt | 68 ++++++++++++++----- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index b4e5ea52a..e7b93fc0a 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -19,22 +19,46 @@ object Baritone : Module( showOnArray = false, alwaysEnabled = true ) { - private val showOnRadar by setting("Show Path on Radar", true, description = "Show the current path on radar.") - private val color by setting("Path Color", ColorHolder(32, 250, 32), visibility = { showOnRadar }) - private val allowBreak by setting("Allow Break", true) - private val allowSprint by setting("Allow Sprint", true) - private val allowPlace by setting("Allow Place", true) - private val allowInventory by setting("Allow Inventory", false) - private val freeLook by setting("Free Look", true) - private val allowWaterBucketFall by setting("Water bucket clutch", true, description = "Uses a water bucket to get down quickly.") - private val maxFallHeightBucket by setting("Max bucket height", 20, 5..255, 5, { allowWaterBucketFall }, description = "Max height that baritone can use a water bucket.") - private val allowDownwardTunneling by setting("Downward Tunneling", true) - private val allowParkour by setting("Allow Parkour", true) - private val allowParkourPlace by setting("Allow Parkour Place", true) - private val avoidPortals by setting("Avoid Portals", false) - private val renderGoal by setting("Render Goals", true) - private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, unit = "s") - private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f) +/* + * Baritone varibles can be found here. + * https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java + */ + private val page by setting("Page", Page.ONE) + + /* Basic */ + private val allowBreak by setting("Allow Break", true, { page == Page.one }, description = "Allow Baritone to break blocks.") + private val allowSprint by setting("Allow Sprint", true, { page == Page.ONE }, description = "Allow Baritone to sprint.") + private val allowPlace by setting("Allow Place", true, { page == Page.ONE }, description = "Allow Baritone to place blocks.") + private val allowInventory by setting("Allow Inventory", false, { page == Page.ONE }, description = "Allow Baritone to move items in your inventory to your hotbar.") + private val freeLook by setting("Free Look", true, { page == Page.ONE }, description = "Move without having to force the client-sided rotations.") + private val allowDownwardTunneling by setting("Downward Tunneling", true, { page == Page.ONE }, description = "Allow mining blocks directly beneath you.") + private val allowParkour by setting("Allow Parkour", true, { page == Page.ONE }) + private val allowParkourPlace by setting("Allow Parkour Place", true, { allowParkour && page == Page.ONE }) + + /* Visual */ + private val showOnRadar by setting("Show Path on Radar", true, { page == Page.TWO }, description = "Show the current path on radar.") + private val color by setting("Path Color", ColorHolder(32, 250, 32), visibility = { showOnRadar && page == Page.TWO }, description = "Path color for the radar.") + private val renderGoal by setting("Render Goals", true, { page == Page.TWO }, description = "Render the goal.") + private val renderGoalAnimated by setting("Render Goal Animated", true, { page == Page.TWO }, description = "Animate the rendered goal.") + + /* Fall */ + private val maxFallHeightNoWater by setting("Max Fall Height", 3, 3..5, 1, { page == Page.THREE }, description = "Distance baritone can fall without water.") + private val allowWaterBucketFall by setting("Water Bucket Clutch", true, { page == Page.THREE }, description = "Uses a water bucket to get down quickly.") + private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.THREE }, description = "Max height that baritone can use a water bucket.") + + /* AI */ + private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.FOUR }, description = "Max distance baritone can place blocks.") + private val enterPortals by setting("Enter Portals", true, { page == Page.FOUR }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") + /*private val avoidance by setting("Avoidance", false, { page == Page.B_AI }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.B_AI }, description = "Distance to avoid mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.B_AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.B_AI }, description = "Distance to avoid mob spawners.") + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.B_AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") + private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.B_AI }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") + private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.B_AI }, description = "Lower chance to break blocks. This is a tiebreaker.") + private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.B_AI }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ + private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.FOUR }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") + private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, unit = "s", { page == Page.FOUR }) init { settingList.forEach { @@ -76,14 +100,24 @@ object Baritone : Module( it.allowSprint.value = allowSprint it.allowPlace.value = allowPlace it.allowInventory.value = allowInventory + /*it.blockPlacementPenalty.value = blockPlacementPenalty + it.blockBreakAdditionalPenalty.value = blockBreakAdditionalPenalty + it.jumpPenalty.value = jumpPenalty*/ + it.assumeWalkOnWater.value = assumeWalkOnWater + /*it.avoidance.value = avoidance + it.mobAvoidanceRadius.value = mobAvoidanceRadius + it.mobAvoidanceCoefficient.value = mobAvoidanceCoefficient + it.mobSpawnerAvoidanceRadius.value = mobSpawnerAvoidanceRadius + it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient*/ it.freeLook.value = freeLook it.allowWaterBucketFall.value = allowWaterBucketFall it.maxFallHeightBucket.value = maxFallHeightBucket it.allowDownward.value = allowDownwardTunneling it.allowParkour.value = allowParkour it.allowParkourPlace.value = allowParkourPlace - it.enterPortal.value = !avoidPortals + it.enterPortal.value = enterPortals it.renderGoal.value = renderGoal + it.failureTimeoutMS.value = failureTimeout * 1000L it.blockReachDistance.value = blockReachDistance } From d6432c4e331b2526554766110a00edbbc267bcaa Mon Sep 17 00:00:00 2001 From: nickcat325 <80810636+nickcat325@users.noreply.github.com> Date: Fri, 7 Oct 2022 11:37:19 -0500 Subject: [PATCH 2/6] Update baritone.kt --- .../client/module/modules/client/Baritone.kt | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index e7b93fc0a..94005a79c 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -23,42 +23,46 @@ object Baritone : Module( * Baritone varibles can be found here. * https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java */ - private val page by setting("Page", Page.ONE) + private val page by setting("Page", Page.BASIC) /* Basic */ - private val allowBreak by setting("Allow Break", true, { page == Page.one }, description = "Allow Baritone to break blocks.") - private val allowSprint by setting("Allow Sprint", true, { page == Page.ONE }, description = "Allow Baritone to sprint.") - private val allowPlace by setting("Allow Place", true, { page == Page.ONE }, description = "Allow Baritone to place blocks.") - private val allowInventory by setting("Allow Inventory", false, { page == Page.ONE }, description = "Allow Baritone to move items in your inventory to your hotbar.") - private val freeLook by setting("Free Look", true, { page == Page.ONE }, description = "Move without having to force the client-sided rotations.") - private val allowDownwardTunneling by setting("Downward Tunneling", true, { page == Page.ONE }, description = "Allow mining blocks directly beneath you.") - private val allowParkour by setting("Allow Parkour", true, { page == Page.ONE }) - private val allowParkourPlace by setting("Allow Parkour Place", true, { allowParkour && page == Page.ONE }) + private val allowBreak by setting("Allow Break", true, { page == Page.BASIC }, description = "Allow Baritone to break blocks.") + private val allowSprint by setting("Allow Sprint", true, { page == Page.BASIC }, description = "Allow Baritone to sprint.") + private val allowPlace by setting("Allow Place", true, { page == Page.BASIC }, description = "Allow Baritone to place blocks.") + private val allowInventory by setting("Allow Inventory", false, { page == Page.BASIC }, description = "Allow Baritone to move items in your inventory to your hotbar.") + private val freeLook by setting("Free Look", true, { page == Page.BASIC }, description = "Move without having to force the client-sided rotations.") + private val allowDownwardTunneling by setting("Downward Tunneling", true, { page == Page.BASIC }, description = "Allow mining blocks directly beneath you.") + private val allowParkour by setting("Allow Parkour", true, { page == Page.BASIC }) + private val allowParkourPlace by setting("Allow Parkour Place", true, { allowParkour && page == Page.BASIC }) /* Visual */ - private val showOnRadar by setting("Show Path on Radar", true, { page == Page.TWO }, description = "Show the current path on radar.") - private val color by setting("Path Color", ColorHolder(32, 250, 32), visibility = { showOnRadar && page == Page.TWO }, description = "Path color for the radar.") - private val renderGoal by setting("Render Goals", true, { page == Page.TWO }, description = "Render the goal.") - private val renderGoalAnimated by setting("Render Goal Animated", true, { page == Page.TWO }, description = "Animate the rendered goal.") + private val showOnRadar by setting("Show Path on Radar", true, { page == Page.VISUAL }, description = "Show the current path on radar.") + private val color by setting("Path Color", ColorHolder(32, 250, 32), visibility = { showOnRadar && page == Page.VISUAL }, description = "Path color for the radar.") + private val renderGoal by setting("Render Goals", true, { page == Page.VISUAL }, description = "Render the goal.") + private val renderGoalAnimated by setting("Render Goal Animated", true, { page == Page.VISUAL }, description = "Animate the rendered goal.") /* Fall */ - private val maxFallHeightNoWater by setting("Max Fall Height", 3, 3..5, 1, { page == Page.THREE }, description = "Distance baritone can fall without water.") - private val allowWaterBucketFall by setting("Water Bucket Clutch", true, { page == Page.THREE }, description = "Uses a water bucket to get down quickly.") - private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.THREE }, description = "Max height that baritone can use a water bucket.") + private val maxFallHeightNoWater by setting("Max Fall Height", 3, 3..5, 1, { page == Page.FALL }, description = "Distance baritone can fall without water.") + private val allowWaterBucketFall by setting("Water Bucket Clutch", true, { page == Page.FALL }, description = "Uses a water bucket to get down quickly.") + private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.FALL }, description = "Max height that baritone can use a water bucket.") /* AI */ - private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.FOUR }, description = "Max distance baritone can place blocks.") - private val enterPortals by setting("Enter Portals", true, { page == Page.FOUR }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") - /*private val avoidance by setting("Avoidance", false, { page == Page.B_AI }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") - private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.B_AI }, description = "Distance to avoid mobs.") - private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.B_AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") - private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.B_AI }, description = "Distance to avoid mob spawners.") - private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.B_AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") - private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.B_AI }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") - private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.B_AI }, description = "Lower chance to break blocks. This is a tiebreaker.") - private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.B_AI }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ - private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.FOUR }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") - private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, unit = "s", { page == Page.FOUR }) + private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.AI }, description = "Max distance baritone can place blocks.") + private val enterPortals by setting("Enter Portals", true, { page == Page.AI }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") + /*private val avoidance by setting("Avoidance", false, { page == Page.AI }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.AI }, description = "Distance to avoid mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.AI }, description = "Distance to avoid mob spawners.") + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") + private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.AI }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") + private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.AI }, description = "Lower chance to break blocks. This is a tiebreaker.") + private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.AI }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ + private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.AI }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") + private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, unit = "s", { page == Page.AI }) + + private enum class Page { + BASIC, VISUAL, FALL, AI + } init { settingList.forEach { @@ -110,6 +114,7 @@ object Baritone : Module( it.mobSpawnerAvoidanceRadius.value = mobSpawnerAvoidanceRadius it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient*/ it.freeLook.value = freeLook + it.maxFallHeightNoWater.value = maxFallHeightNoWater it.allowWaterBucketFall.value = allowWaterBucketFall it.maxFallHeightBucket.value = maxFallHeightBucket it.allowDownward.value = allowDownwardTunneling @@ -117,7 +122,7 @@ object Baritone : Module( it.allowParkourPlace.value = allowParkourPlace it.enterPortal.value = enterPortals it.renderGoal.value = renderGoal - + it.failureTimeoutMS.value = failureTimeout * 1000L it.blockReachDistance.value = blockReachDistance } From d3f42afac1d6e120cc71e82f92d8b15ae38f6e6d Mon Sep 17 00:00:00 2001 From: nickcat325 <80810636+nickcat325@users.noreply.github.com> Date: Tue, 11 Oct 2022 02:49:22 -0500 Subject: [PATCH 3/6] Compile fix All of the original stuff and more works. --- .../client/module/modules/client/Baritone.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index 94005a79c..d07f1f841 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -46,22 +46,22 @@ object Baritone : Module( private val allowWaterBucketFall by setting("Water Bucket Clutch", true, { page == Page.FALL }, description = "Uses a water bucket to get down quickly.") private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.FALL }, description = "Max height that baritone can use a water bucket.") - /* AI */ - private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.AI }, description = "Max distance baritone can place blocks.") - private val enterPortals by setting("Enter Portals", true, { page == Page.AI }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") - /*private val avoidance by setting("Avoidance", false, { page == Page.AI }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") - private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.AI }, description = "Distance to avoid mobs.") - private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") - private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.AI }, description = "Distance to avoid mob spawners.") - private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.AI }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") - private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.AI }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") - private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.AI }, description = "Lower chance to break blocks. This is a tiebreaker.") - private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.AI }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ - private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.AI }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") - private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, unit = "s", { page == Page.AI }) + /* Advanced */ + private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVACED }, description = "Max distance baritone can place blocks.") + private val enterPortals by setting("Enter Portals", true, { page == Page.ADVACED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") + /*private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mob spawners.") + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") + private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.ADVACED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") + private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.ADVACED }, description = "Lower chance to break blocks. This is a tiebreaker.") + private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.ADVACED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ + private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.ADVACED }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") + private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, { page == Page.ADVACED }, unit = "s") private enum class Page { - BASIC, VISUAL, FALL, AI + BASIC, VISUAL, FALL, ADVACED } init { @@ -107,12 +107,12 @@ object Baritone : Module( /*it.blockPlacementPenalty.value = blockPlacementPenalty it.blockBreakAdditionalPenalty.value = blockBreakAdditionalPenalty it.jumpPenalty.value = jumpPenalty*/ - it.assumeWalkOnWater.value = assumeWalkOnWater /*it.avoidance.value = avoidance it.mobAvoidanceRadius.value = mobAvoidanceRadius it.mobAvoidanceCoefficient.value = mobAvoidanceCoefficient it.mobSpawnerAvoidanceRadius.value = mobSpawnerAvoidanceRadius it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient*/ + it.assumeWalkOnWater.value = assumeWalkOnWater it.freeLook.value = freeLook it.maxFallHeightNoWater.value = maxFallHeightNoWater it.allowWaterBucketFall.value = allowWaterBucketFall From 1c695b0df16cbd360e57d94ad148520b8782c479 Mon Sep 17 00:00:00 2001 From: nickcat325 <80810636+nickcat325@users.noreply.github.com> Date: Tue, 11 Oct 2022 19:45:30 -0500 Subject: [PATCH 4/6] New Baritone controls --- .../client/module/modules/client/Baritone.kt | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index d07f1f841..74773b913 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -49,14 +49,14 @@ object Baritone : Module( /* Advanced */ private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVACED }, description = "Max distance baritone can place blocks.") private val enterPortals by setting("Enter Portals", true, { page == Page.ADVACED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") - /*private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mobs.") - private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mob spawners.") - private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5, 0..5, 0.5, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") - private val blockPlacementPenalty by setting("Block Placement Penalty", 20.0D, 0.0D..40.0D, 5.0D, { page == Page.ADVACED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") - private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.ADVACED }, description = "Lower chance to break blocks. This is a tiebreaker.") - private val jumpPenalty by setting("Jump Penalty", 2.0D, 0.0D..10.0D, 1.0D, { page == Page.ADVACED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.")*/ + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") + private val blockPlacementPenalty by setting("Block Placement Penalty", 20, 0..40, 5, { page == Page.ADVACED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") + private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Lower chance to break blocks. This is a tiebreaker.") + private val jumpPenalty by setting("Jump Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.") private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.ADVACED }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, { page == Page.ADVACED }, unit = "s") @@ -104,14 +104,16 @@ object Baritone : Module( it.allowSprint.value = allowSprint it.allowPlace.value = allowPlace it.allowInventory.value = allowInventory - /*it.blockPlacementPenalty.value = blockPlacementPenalty - it.blockBreakAdditionalPenalty.value = blockBreakAdditionalPenalty - it.jumpPenalty.value = jumpPenalty*/ - /*it.avoidance.value = avoidance + + it.blockPlacementPenalty.value = blockPlacementPenalty.toDouble() + it.blockBreakAdditionalPenalty.value = blockBreakAdditionalPenalty.toDouble() + it.avoidance.value = avoidance it.mobAvoidanceRadius.value = mobAvoidanceRadius - it.mobAvoidanceCoefficient.value = mobAvoidanceCoefficient + it.mobAvoidanceCoefficient.value = mobAvoidanceCoefficient.toDouble() it.mobSpawnerAvoidanceRadius.value = mobSpawnerAvoidanceRadius - it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient*/ + it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient.toDouble() + it.jumpPenalty.value = jumpPenalty.toDouble() + it.assumeWalkOnWater.value = assumeWalkOnWater it.freeLook.value = freeLook it.maxFallHeightNoWater.value = maxFallHeightNoWater From 6971d263ef9d1879644b5ba0a7f502665ddd1f70 Mon Sep 17 00:00:00 2001 From: nickcat325 <80810636+nickcat325@users.noreply.github.com> Date: Wed, 12 Oct 2022 03:54:54 -0500 Subject: [PATCH 5/6] Baritone.kt complete --- .../client/module/modules/client/Baritone.kt | 60 +++++++++++-------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index 74773b913..bf191e6c2 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -27,19 +27,22 @@ object Baritone : Module( /* Basic */ private val allowBreak by setting("Allow Break", true, { page == Page.BASIC }, description = "Allow Baritone to break blocks.") - private val allowSprint by setting("Allow Sprint", true, { page == Page.BASIC }, description = "Allow Baritone to sprint.") private val allowPlace by setting("Allow Place", true, { page == Page.BASIC }, description = "Allow Baritone to place blocks.") + private val allowSprint by setting("Allow Sprint", true, { page == Page.BASIC }, description = "Allow Baritone to sprint.") private val allowInventory by setting("Allow Inventory", false, { page == Page.BASIC }, description = "Allow Baritone to move items in your inventory to your hotbar.") - private val freeLook by setting("Free Look", true, { page == Page.BASIC }, description = "Move without having to force the client-sided rotations.") private val allowDownwardTunneling by setting("Downward Tunneling", true, { page == Page.BASIC }, description = "Allow mining blocks directly beneath you.") private val allowParkour by setting("Allow Parkour", true, { page == Page.BASIC }) private val allowParkourPlace by setting("Allow Parkour Place", true, { allowParkour && page == Page.BASIC }) + private val buildInLayers by setting("Build In Layers", false, { page == Page.BASIC }, description = "Build/mine one layer at a time in schematics and selections.") + private val layerOrder by setting("Top To Bottom", false, { buildInLayers && page == Page.BASIC }, description = "Build/mine from top to bottom in schematics and selections.") /* Visual */ + private val freeLook by setting("Free Look", true, { page == Page.VISUAL }, description = "Move without having to force the client-sided rotations.") + private val renderGoal by setting("Render Goals", true, { page == Page.VISUAL }, description = "Render the goal.") + private val censorCoordinates by setting("Censor Coordinates", false, { page == Page.VISUAL }, description = "Censor coordinates in goals and block positions.") + private val censorRanCommands by setting("Censor RanCommands", false, { page == Page.VISUAL }, description = "Censor arguments to ran commands, to hide, for example, coordinates to #goal.") private val showOnRadar by setting("Show Path on Radar", true, { page == Page.VISUAL }, description = "Show the current path on radar.") private val color by setting("Path Color", ColorHolder(32, 250, 32), visibility = { showOnRadar && page == Page.VISUAL }, description = "Path color for the radar.") - private val renderGoal by setting("Render Goals", true, { page == Page.VISUAL }, description = "Render the goal.") - private val renderGoalAnimated by setting("Render Goal Animated", true, { page == Page.VISUAL }, description = "Animate the rendered goal.") /* Fall */ private val maxFallHeightNoWater by setting("Max Fall Height", 3, 3..5, 1, { page == Page.FALL }, description = "Distance baritone can fall without water.") @@ -49,16 +52,16 @@ object Baritone : Module( /* Advanced */ private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVACED }, description = "Max distance baritone can place blocks.") private val enterPortals by setting("Enter Portals", true, { page == Page.ADVACED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") - private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") - private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mobs.") - private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") - private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mob spawners.") - private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") private val blockPlacementPenalty by setting("Block Placement Penalty", 20, 0..40, 5, { page == Page.ADVACED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Lower chance to break blocks. This is a tiebreaker.") private val jumpPenalty by setting("Jump Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.") private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.ADVACED }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, { page == Page.ADVACED }, unit = "s") + private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mob spawners.") + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") private enum class Page { BASIC, VISUAL, FALL, ADVACED @@ -100,33 +103,38 @@ object Baritone : Module( private fun sync() { BaritoneUtils.settings?.let { it.chatControl.value = false // enable chatControlAnyway if you want to use it + /* Basic */ it.allowBreak.value = allowBreak - it.allowSprint.value = allowSprint it.allowPlace.value = allowPlace + it.allowSprint.value = allowSprint it.allowInventory.value = allowInventory - + it.allowDownward.value = allowDownwardTunneling + it.allowParkour.value = allowParkour + it.allowParkourPlace.value = allowParkourPlace + it.buildInLayers.value = buildInLayers + it.layerOrder.value = layerOrder + /* Visual */ + it.freeLook.value = freeLook + it.renderGoal.value = renderGoal + it.censorCoordinates.value = censorCoordinates + it.censorRanCommands.value = censorRanCommands + /* Fall */ + it.maxFallHeightNoWater.value = maxFallHeightNoWater + it.allowWaterBucketFall.value = allowWaterBucketFall + it.maxFallHeightBucket.value = maxFallHeightBucket + /* Advanced */ + it.blockReachDistance.value = blockReachDistance + it.enterPortal.value = enterPortals it.blockPlacementPenalty.value = blockPlacementPenalty.toDouble() it.blockBreakAdditionalPenalty.value = blockBreakAdditionalPenalty.toDouble() + it.jumpPenalty.value = jumpPenalty.toDouble() + it.assumeWalkOnWater.value = assumeWalkOnWater + it.failureTimeoutMS.value = failureTimeout * 1000L it.avoidance.value = avoidance it.mobAvoidanceRadius.value = mobAvoidanceRadius it.mobAvoidanceCoefficient.value = mobAvoidanceCoefficient.toDouble() it.mobSpawnerAvoidanceRadius.value = mobSpawnerAvoidanceRadius it.mobSpawnerAvoidanceCoefficient.value = mobSpawnerAvoidanceCoefficient.toDouble() - it.jumpPenalty.value = jumpPenalty.toDouble() - - it.assumeWalkOnWater.value = assumeWalkOnWater - it.freeLook.value = freeLook - it.maxFallHeightNoWater.value = maxFallHeightNoWater - it.allowWaterBucketFall.value = allowWaterBucketFall - it.maxFallHeightBucket.value = maxFallHeightBucket - it.allowDownward.value = allowDownwardTunneling - it.allowParkour.value = allowParkour - it.allowParkourPlace.value = allowParkourPlace - it.enterPortal.value = enterPortals - it.renderGoal.value = renderGoal - - it.failureTimeoutMS.value = failureTimeout * 1000L - it.blockReachDistance.value = blockReachDistance } } } From 0445dd9600588af7861ef7eae3a7cd392bef90c8 Mon Sep 17 00:00:00 2001 From: Constructor Date: Mon, 14 Nov 2022 04:12:16 +0100 Subject: [PATCH 6/6] Fix typos --- .../client/module/modules/client/Baritone.kt | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt index bf191e6c2..e7f46d785 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/client/Baritone.kt @@ -19,10 +19,11 @@ object Baritone : Module( showOnArray = false, alwaysEnabled = true ) { -/* - * Baritone varibles can be found here. - * https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java - */ + /* + * Baritone variables can be found here. + * https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java + */ + private val page by setting("Page", Page.BASIC) /* Basic */ @@ -50,21 +51,21 @@ object Baritone : Module( private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.FALL }, description = "Max height that baritone can use a water bucket.") /* Advanced */ - private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVACED }, description = "Max distance baritone can place blocks.") - private val enterPortals by setting("Enter Portals", true, { page == Page.ADVACED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") - private val blockPlacementPenalty by setting("Block Placement Penalty", 20, 0..40, 5, { page == Page.ADVACED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") - private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Lower chance to break blocks. This is a tiebreaker.") - private val jumpPenalty by setting("Jump Penalty", 2, 0..10, 1, { page == Page.ADVACED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.") - private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.ADVACED }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") - private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, { page == Page.ADVACED }, unit = "s") - private val avoidance by setting("Avoidance", false, { page == Page.ADVACED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") - private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mobs.") - private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") - private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVACED }, description = "Distance to avoid mob spawners.") - private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVACED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") + private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVANCED }, description = "Max distance baritone can place blocks.") + private val enterPortals by setting("Enter Portals", true, { page == Page.ADVANCED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.") + private val blockPlacementPenalty by setting("Block Placement Penalty", 20, 0..40, 5, { page == Page.ADVANCED }, description = "Decrease to make Baritone more often consider paths that would require placing blocks.") + private val blockBreakAdditionalPenalty by setting("Block Break Additional Penalty", 2, 0..10, 1, { page == Page.ADVANCED }, description = "Lower chance to break blocks. This is a tiebreaker.") + private val jumpPenalty by setting("Jump Penalty", 2, 0..10, 1, { page == Page.ADVANCED }, description = "Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger.") + private val assumeWalkOnWater by setting("Assume Walk On Water", false, { page == Page.ADVANCED }, description = "Allow Baritone to assume it can walk on still water just like any other block. Requires jesus to be enabled.") + private val failureTimeout by setting("Fail Timeout", 2, 1..20, 1, { page == Page.ADVANCED }, unit = "s") + private val avoidance by setting("Avoidance", false, { page == Page.ADVANCED }, description = "Enables the 4 avoidance settings. It's disabled by default because of the noticeable performance impact.") + private val mobAvoidanceRadius by setting("Mob Avoidance Radius", 15, 0..65, 5, visibility = { avoidance && page == Page.ADVANCED }, description = "Distance to avoid mobs.") + private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVANCED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.") + private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVANCED }, description = "Distance to avoid mob spawners.") + private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVANCED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.") private enum class Page { - BASIC, VISUAL, FALL, ADVACED + BASIC, VISUAL, FALL, ADVANCED } init {