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

Add a timer "only when inputting" option #370

Merged
merged 3 commits into from
Sep 4, 2022
Merged
Changes from 2 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 @@ -5,6 +5,7 @@ import com.lambda.client.manager.managers.TimerManager.modifyTimer
import com.lambda.client.manager.managers.TimerManager.resetTimer
import com.lambda.client.module.Category
import com.lambda.client.module.Module
import com.lambda.client.util.MovementUtils
import net.minecraftforge.fml.common.gameevent.TickEvent

object Timer : Module(
Expand All @@ -13,6 +14,7 @@ object Timer : Module(
category = Category.PLAYER,
modulePriority = 500
) {
private val onlyWhenInputting by setting("Only When Inputting", false)
private val slow by setting("Slow Mode", false)
private val tickNormal by setting("Tick N", 2.0f, 1f..10f, 0.1f, { !slow })
private val tickSlow by setting("Tick S", 8f, 1f..10f, 0.1f, { slow })
Expand All @@ -26,7 +28,9 @@ object Timer : Module(
if (it.phase != TickEvent.Phase.END) return@listener

val multiplier = if (!slow) tickNormal else tickSlow / 10.0f
modifyTimer(50.0f / multiplier)
if (onlyWhenInputting) {
if (MovementUtils.isInputting) modifyTimer(50.0f / multiplier)
} else modifyTimer(50.0f / multiplier)
}
}
}