Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce unit suffix for metric based setting parameter #335

Merged
merged 2 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.lambda.client.commons.extension
import com.lambda.client.commons.interfaces.DisplayEnum
import com.lambda.client.util.text.capitalize

fun <E : Enum<E>> E.next(): E = declaringClass.enumConstants.run {
fun <E : Enum<E>> E.next(): E = declaringJavaClass.enumConstants.run {
get((ordinal + 1) % size)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object PlayerInventoryManager : Manager {
fun isDone() = actionQueue.isEmpty()

/**
* Adds a new task to the inventory manager
* Adds a new task to the inventory manager respecting the module origin.
*
* @param clickInfo group of the click info in this task
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object AntiSpam : Module(
/* Page Two */
private val aggressiveFiltering by setting("Aggressive Filtering", true, { page == Page.SETTINGS })
private val duplicates by setting("Duplicates", true, { page == Page.SETTINGS })
private val duplicatesTimeout by setting("Duplicates Timeout", 30, 1..600, 5, { duplicates && page == Page.SETTINGS })
private val duplicatesTimeout by setting("Duplicates Timeout", 30, 1..600, 5, { duplicates && page == Page.SETTINGS }, unit = "s")
private val filterOwn by setting("Filter Own", false, { page == Page.SETTINGS })
private val filterDMs by setting("Filter DMs", false, { page == Page.SETTINGS })
private val filterServer by setting("Filter Server", false, { page == Page.SETTINGS })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object AutoQMain : Module(
category = Category.CHAT,
showOnArray = false
) {
private val delay by setting("Delay", 30, 1..120, 5)
private val delay by setting("Delay", 30, 1..120, 5, unit = "s")
private val twoBeeCheck by setting("2B Check", true)
private val command by setting("Command", "/queue main")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object Spammer : Module(
modulePriority = 100
) {
private val modeSetting by setting("Order", Mode.RANDOM_ORDER)
private val delay by setting("Delay", 10, 1..600, 1, description = "Delay between messages, in seconds")
private val delay by setting("Delay", 10, 1..600, 1, description = "Delay between messages", unit = "s")
private val loadRemote by setting("Load From URL", false)
private val remoteURL by setting("Remote URL", "Unchanged", { loadRemote })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object Baritone : Module(
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)
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)

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ object ChatSetting : Module(
showOnArray = false,
alwaysEnabled = true
) {
val delay by setting("Message Speed Limit", 0.5f, 0.1f..20.0f, 0.1f, description = "Delay between each message in seconds")
val delay by setting("Message Speed Limit", 0.5f, 0.1f..20.0f, 0.1f, description = "Delay between each message", unit = "s")
val maxMessageQueueSize by setting("Max Message Queue Size", 50, 10..200, 5)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ object ClickGUI : Module(
alwaysListening = true
) {
private val scaleSetting = setting("Scale", 100, 50..400, 5)
val radius by setting("Corner Radius", 2.0, 0.0..10.0, 0.2)
val radius by setting("Corner Radius", 2.0, 0.0..10.0, 0.2, unit = "px")
val blur by setting("Blur", 0.0f, 0.0f..1.0f, 0.05f)
val windowOutline by setting("Window Outline", false)
val buttonOutline by setting("Button Outline", false)
val outlineWidth by setting("Outline Width", 2.5f, 0.5f..3.5f, 0.5f, { windowOutline || buttonOutline })
val entryMargin by setting("Margin", 0.0f, 0.0f..10.0f, 0.5f)
val entryMargin by setting("Margin", 0.0f, 0.0f..10.0f, 0.5f, unit = "px")
val darkness by setting("Darkness", 0.25f, 0.0f..1.0f, 0.05f)
val fadeInTime by setting("Fade In Time", 0.25f, 0.0f..1.0f, 0.05f)
val fadeOutTime by setting("Fade Out Time", 0.1f, 0.0f..1.0f, 0.05f)
val fadeInTime by setting("Fade In Time", 0.25f, 0.0f..1.0f, 0.05f, unit = "s")
val fadeOutTime by setting("Fade Out Time", 0.1f, 0.0f..1.0f, 0.05f, unit = "s")
val showModifiedInBold by setting("Show Modified In Bold", false, description = "Display modified settings in a bold font")
private val resetComponents = setting("Reset Positions", false)
private val resetScale = setting("Reset Scale", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal object Configurations : AbstractModule(

private val autoSaving by setting("Auto Saving", true)
private val savingFeedBack by setting("Log autosaves in chat", false, { autoSaving })
private val savingInterval by setting("Interval", 10, 1..30, 1, { autoSaving }, description = "Frequency of auto saving in minutes")
private val savingInterval by setting("Interval", 10, 1..30, 1, { autoSaving }, description = "Frequency of auto saving", unit = "m")
val serverPreset by setting("Server Preset", false)
private val guiPresetSetting = setting("Gui Preset", defaultPreset)
private val modulePresetSetting = setting("Module Preset", defaultPreset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object AutoArmor : Module(
category = Category.COMBAT,
modulePriority = 500
) {
private val delay by setting("Delay", 5, 1..10, 1)
private val delay by setting("Delay", 5, 1..10, 1, unit = " ticks")

private val timer = TickTimer(TimeUnit.TICKS)
private var lastTask = TaskState(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object AutoMend : Module(
category = Category.COMBAT
) {
private val autoThrow by setting("Auto Throw", true)
private val throwDelay = setting("Throw Delay", 2, 0..5, 1, description = "Number of ticks between throws to allow absorption")
private val throwDelay = setting("Throw Delay", 2, 0..5, 1, description = "Number of ticks between throws to allow absorption", unit = " ticks")
private val autoSwitch by setting("Auto Switch", true)
private val autoDisableExp by setting("Auto Disable", false, { autoSwitch }, description = "Disable when you run out of XP bottles")
private val autoDisableComplete by setting("Disable on Complete", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object CombatSetting : Module(
private val pauseForEating by setting("Pause For Eating", true, { page == Page.IN_COMBAT })
private val ignoreOffhandEating by setting("Ignore Offhand Eating", true, { page == Page.IN_COMBAT && pauseForEating })
private val pauseBaritone by setting("Pause Baritone", true, { page == Page.IN_COMBAT })
private val resumeDelay by setting("Resume Delay", 3, 1..10, 1, { page == Page.IN_COMBAT && pauseBaritone })
private val resumeDelay by setting("Resume Delay", 3, 1..10, 1, { page == Page.IN_COMBAT && pauseBaritone }, unit = "s")
private val motionPrediction by setting("Motion Prediction", true, { page == Page.IN_COMBAT })
private val pingSync by setting("Ping Sync", true, { page == Page.IN_COMBAT && motionPrediction })
private val ticksAhead by setting("Ticks Ahead", 5, 0..20, 1, { page == Page.IN_COMBAT && motionPrediction && !pingSync })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object HoleMiner : Module(
category = Category.COMBAT,
modulePriority = 100
) {
private val delay by setting("Delay", 2, 1..10, 1)
private val delay by setting("Delay", 2, 1..10, 1, unit = " ticks")
private val range by setting("Range", 5.0f, 1.0f..8.0f, 0.25f)

private val timer = TickTimer(TimeUnit.TICKS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ object KillAura : Module(
) {
private val mode by setting("Mode", Mode.COOLDOWN)
private val rotationMode by setting("Rotation Mode", RotationMode.SPOOF)
private val attackDelay by setting("Attack Delay", 5, 1..40, 1, { mode == Mode.TICKS })
private val attackDelay by setting("Attack Delay", 5, 1..40, 1, { mode == Mode.TICKS }, unit = " ticks")
private val disableOnDeath by setting("Disable On Death", false)
private val tpsSync by setting("TPS Sync", false)
private val weaponOnly by setting("Weapon Only", false)
private val autoWeapon by setting("Auto Weapon", true)
private val prefer by setting("Prefer", CombatUtils.PreferWeapon.SWORD, { autoWeapon })
private val minSwapHealth by setting("Min Swap Health", 5.0f, 1.0f..20.0f, 0.5f)
private val swapDelay by setting("Swap Delay", 10, 0..50, 1)
private val swapDelay by setting("Swap Delay", 10, 0..50, 1, unit = " ticks")
private val fireballs by setting("Target Fireballs", false)
private val fireballForceViewLock by setting("Force ViewLock", true, { fireballs }, description = "Only applies to fireballs")
val range by setting("Range", 4.0f, 0.0f..6.0f, 0.1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ object Surround : Module(
private val disableStrafe by setting("Disable Strafe", true)
private val strictDirection by setting("Strict Direction", false)
private val autoDisable by setting("Auto Disable", AutoDisableMode.OUT_OF_HOLE)
private val outOfHoleTimeout by setting("Out Of Hole Timeout", 10, 1..50, 5, { autoDisable == AutoDisableMode.OUT_OF_HOLE }, description = "Delay before disabling Surround when you are out of hole, in ticks")
private val outOfHoleTimeout by setting("Out Of Hole Timeout", 10, 1..50, 5, { autoDisable == AutoDisableMode.OUT_OF_HOLE }, description = "Delay before disabling Surround when you are out of hole", unit = " ticks")
private val enableInHole = setting("Enable In Hole", false)
private val inHoleTimeout by setting("In Hole Timeout", 50, 1..100, 5, { enableInHole.value }, description = "Delay before enabling Surround when you are in hole, in ticks")
private val inHoleTimeout by setting("In Hole Timeout", 50, 1..100, 5, { enableInHole.value }, description = "Delay before enabling Surround when you are in hole", unit = " ticks")
private val toggleMessage by setting("Toggle Message", true)

private enum class AutoDisableMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ object AntiAFK : Module(
description = "Prevents being kicked for AFK",
category = Category.MISC
) {
private val delay by setting("Action Delay", 50, 5..100, 5)
private val variation by setting("Variation", 25, 0..50, 5)
private val delay by setting("Action Delay", 50, 5..100, 5, unit = " ticks")
private val variation by setting("Variation", 25, 0..50, 5, unit = " ticks")
private val autoReply by setting("Auto Reply", true)
private val replyMessage by setting("Reply Message", "I am AFK with Lambda!", { autoReply })
private val swing = setting("Swing", true)
private val jump = setting("Jump", true)
private val turn = setting("Turn", true)
private val walk = setting("Walk", true)
private val radius by setting("Radius", 64, 8..128, 8, fineStep = 1)
private val inputTimeout by setting("Idle Timeout", 0, 0..15, 1, description = "Starts AntiAFK after being idle for longer than specific minutes, 0 to disable")
private val inputTimeout by setting("Idle Timeout", 0, 0..15, 1, description = "Starts AntiAFK after being idle for longer than specific minutes, 0 to disable", unit = "m")
private val allowBreak by setting("Allow Breaking Blocks", false, { walk.value })

private var startPos: BlockPos? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ object AutoFish : Module(
) {
private val mode by setting("Mode", Mode.BOUNCE)
private val autoCast by setting("Auto Cast", true)
private val castDelay by setting("Auto Cast Delay", 5, 1..20, 1, { autoCast }, description = "Delay before starting fishing when holding a fishing rod, in seconds")
private val catchDelay by setting("Catch Delay", 300, 50..2000, 50, description = "Delay before catching the fish, in milliseconds")
private val recastDelay by setting("Recast Delay", 450, 50..2000, 50, description = "Delay before recasting the fishing rod, in milliseconds")
private val variation by setting("Variation", 100, 0..1000, 50, description = "Randomize the delays in specific range, in milliseconds")
private val castDelay by setting("Auto Cast Delay", 5, 1..20, 1, { autoCast }, description = "Delay before starting fishing when holding a fishing rod", unit = "s")
private val catchDelay by setting("Catch Delay", 300, 50..2000, 50, description = "Delay before catching the fish", unit = "ms")
private val recastDelay by setting("Recast Delay", 450, 50..2000, 50, description = "Delay before recasting the fishing rod", unit = "ms")
private val variation by setting("Variation", 100, 0..1000, 50, description = "Randomize the delays in specific range", unit = "ms")

@Suppress("UNUSED")
private enum class Mode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ object AutoObsidian : Module(
private val autoRefill by setting("Auto Refill", false, { fillMode != FillMode.INFINITE })
private val threshold by setting("Refill Threshold", 32, 1..64, 1, { autoRefill && fillMode != FillMode.INFINITE })
private val targetStacks by setting("Target Stacks", 1, 1..20, 1, { fillMode == FillMode.TARGET_STACKS })
private val delayTicks by setting("Delay Ticks", 4, 1..10, 1)
private val delayTicks by setting("Delay", 4, 1..10, 1, unit = " ticks")
private val rotationMode by setting("Rotation Mode", RotationMode.SPOOF)
private val maxReach by setting("Max Reach", 4.9f, 2.0f..6.0f, 0.1f)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object AutoReconnect : Module(
category = Category.MISC,
alwaysListening = true
) {
private val delay by setting("Delay", 5.0f, 0.5f..100.0f, 0.5f)
private val delay by setting("Delay", 5.0f, 0.5f..100.0f, 0.5f, unit = "s")

private var prevServerDate: ServerData? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object AutoTool : Module(
category = Category.MISC
) {
private val switchBack = setting("Switch Back", true)
private val timeout by setting("Timeout", 20, 1..100, 5, { switchBack.value })
private val timeout by setting("Timeout", 20, 1..100, 5, { switchBack.value }, unit = "s")
private val swapWeapon by setting("Switch Weapon", false)
private val preferWeapon by setting("Prefer", CombatUtils.PreferWeapon.SWORD)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object CoordsLog : Module(
) {
private val saveOnDeath by setting("Save On Death", true)
private val autoLog by setting("Automatically Log", false)
private val delay by setting("Delay", 15, 1..60, 1)
private val delay by setting("Delay", 15, 1..60, 1, unit = "s")

private var previousCoord: String? = null
private var savedDeath = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object PingSpoof : Module(
description = "Cancels or adds delay to your ping packets",
category = Category.MISC
) {
private val delay by setting("Delay", 100, 0..2000, 25)
private val delay by setting("Delay", 100, 0..2000, 25, unit = "ms")

init {
listener<PacketEvent.Receive> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object SkinFlicker : Module(
category = Category.MISC
) {
private val mode by setting("Mode", FlickerMode.HORIZONTAL)
private val delay by setting("Delay", 10, 0..500, 5, description = "Skin layer toggle delay, in milliseconds")
private val delay by setting("Delay", 10, 0..500, 5, description = "Skin layer toggle delay", unit = "ms")

private enum class FlickerMode {
HORIZONTAL, VERTICAL, RANDOM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object AutoJump : Module(
description = "Automatically jumps if possible",
category = Category.MOVEMENT
) {
private val delay by setting("Tick Delay", 10, 0..40, 1)
private val delay by setting("Delay", 10, 0..40, 1, unit = " ticks")

private val timer = TickTimer(TimeUnit.TICKS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object Flight : Module(
private val upSpeed by setting("Up Speed", 0.0622, 0.0..0.3, 0.001, { mode == FlightMode.PACKET })
private val antiKick by setting("Anti Kick", true, { mode == FlightMode.PACKET })
private val antiKickSpeed by setting("Anti Kick Speed", 0.0622, 0.0..0.3, 0.001, { mode == FlightMode.PACKET && antiKick })
private val antiKickDelay by setting("Anti Kick Delay", 14, 0..100, 1, { mode == FlightMode.PACKET && antiKick})
private val antiKickDelay by setting("Anti Kick Delay", 14, 0..100, 1, { mode == FlightMode.PACKET && antiKick }, unit = " ticks")
private val hShrinkAmount by setting("Horizontal Shrink Amount", 4.0, 1.0..10.0, 0.1, { mode == FlightMode.PACKET })
private val vShrinkAmount by setting("Vertical Shrink Amount", 2.70, 1.0..10.0, 0.1, { mode == FlightMode.PACKET })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ object Speed : Module(

private fun SafeClientEvent.strafe() {
player.jumpMovementFactor = strafeAirSpeedBoost
if (strafeTimerBoost) modifyTimer(45.87155914306640625f)
if (strafeTimerBoost) modifyTimer(45.87156f)
if ((Step.isDisabled || !player.collidedHorizontally) && strafeAutoJump) jump()

strafeTimer.reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object Scaffold : Module(
val safeWalk by setting("Safe Walk", true)
private val sneak by setting("Sneak", true)
private val strictDirection by setting("Strict Direction", false)
private val delay by setting("Delay", 2, 1..10, 1)
private val delay by setting("Delay", 2, 1..10, 1, unit = " ticks")
private val maxRange by setting("Max Range", 1, 0..3, 1)

private var lastHitVec: Vec3d? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ object CameraClip : Module(
category = Category.RENDER,
showOnArray = false
) {
val distance by setting("Distance", 4.0, 1.0..10.0, 0.1, description = "Distance to player")
val distance by setting("Distance", 4.0, 1.0..10.0, 0.1, description = "Distance to player", unit = " blocks")
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object ESP : Module(
private val neutral by setting("Neutral Mobs", true, { page == Page.ENTITY_TYPE && !all && mobs })
private val hostile by setting("Hostile Mobs", true, { page == Page.ENTITY_TYPE && !all && mobs })
private val invisible by setting("Invisible", true, { page == Page.ENTITY_TYPE && !all })
private val range by setting("Range", 32.0f, 8.0f..64.0f, 0.5f, { page == Page.ENTITY_TYPE })
private val range by setting("Range", 32.0f, 8.0f..64.0f, 0.5f, { page == Page.ENTITY_TYPE }, unit = " blocks")

/* Rendering settings */
private val mode = setting("Mode", ESPMode.SHADER, { page == Page.RENDERING })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object EyeFinder : Module(
private val neutral by setting("Neutral Mobs", true, { page == Page.ENTITY_TYPE && mobs })
private val hostile by setting("Hostile Mobs", true, { page == Page.ENTITY_TYPE && mobs })
private val invisible by setting("Invisible", true, { page == Page.ENTITY_TYPE })
private val range by setting("Range", 64, 8..128, 8, { page == Page.ENTITY_TYPE })
private val range by setting("Range", 64, 8..128, 8, { page == Page.ENTITY_TYPE }, unit = " blocks")

/* Rendering settings */
private val color by setting("Color", ColorHolder(155, 144, 255, 200), visibility = { page == Page.RENDERING })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object FullBright : Module(
alwaysListening = true
) {
private val gamma by setting("Gamma", 12.0f, 5.0f..15.0f, 0.5f)
private val transitionLength by setting("Transition Length", 3.0f, 0.0f..10.0f, 0.5f)
private val transitionLength by setting("Transition Length", 3.0f, 0.0f..10.0f, 0.5f, unit = "s")
private var oldValue by setting("Old Value", 1.0f, 0.0f..1.0f, 0.1f, { false })

private var gammaSetting: Float
Expand Down
Loading