Skip to content

Commit

Permalink
Fixed Relic Triggerbot
Browse files Browse the repository at this point in the history
  • Loading branch information
odtheking committed Oct 28, 2024
1 parent 67961c3 commit 8b9d287
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import me.odinclient.utils.skyblock.PlayerUtils
import me.odinclient.utils.skyblock.PlayerUtils.leftClick
import me.odinmain.features.Category
import me.odinmain.features.Module
import me.odinmain.features.impl.floor7.KingRelics.currentRelic
import me.odinmain.features.settings.Setting.Companion.withDependency
import me.odinmain.features.settings.impl.*
import me.odinmain.utils.*
Expand Down Expand Up @@ -87,7 +86,7 @@ object Triggerbot : Module(
PlayerUtils.rightClick()
tbClock.update()
}
Vec2(obj.blockPos?.x ?: 0, obj.blockPos?.z ?: 0) == cauldronMap[currentRelic.id] && obj.blockPos?.y.equalsOneOf(6, 7) -> {
Vec2(obj.blockPos?.x ?: 0, obj.blockPos?.z ?: 0) == cauldronMap[mc.thePlayer?.heldItem?.skyblockID ?: ""] && obj.blockPos?.y.equalsOneOf(6, 7) -> {
PlayerUtils.rightClick()
tbClock.update()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.odinmain.features.impl.floor7

import me.odinmain.OdinMain.mc
import me.odinmain.features.impl.floor7.WitherDragons.colors
import me.odinmain.features.impl.floor7.WitherDragons.relicAnnounceTime
import me.odinmain.features.impl.floor7.WitherDragons.selected
import me.odinmain.utils.equalsOneOf
Expand Down Expand Up @@ -35,7 +34,7 @@ object KingRelics {
var relicTicksToSpawn = 0

fun relicsOnMessage(){
if (WitherDragons.relicAnnounce) partyMessage("${colors[selected]} Relic")
if (WitherDragons.relicAnnounce) partyMessage("${Relic.entries[selected]} Relic")
relicPlaceTimer = System.currentTimeMillis()
relicTicksToSpawn = WitherDragons.relicSpawnTicks
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ enum class WitherDragonsEnum (
var entity: EntityDragon? = null,
var isSprayed: Boolean = false,
var spawnedTime: Long = 0,
val skipKillTime: Long = 0L
val skipKillTime: Int = 0
) {
Red(Vec3(27.0, 14.0, 59.0), AxisAlignedBB(14.5, 13.0, 45.5, 39.5, 28.0, 70.5),'c', Color.RED,
24.0..30.0, 56.0..62.0, skipKillTime = 2500),
24.0..30.0, 56.0..62.0, skipKillTime = 50),

Orange(Vec3(85.0, 14.0, 56.0), AxisAlignedBB(72.0, 8.0, 47.0, 102.0,28.0, 77.0),'6', Color.ORANGE,
82.0..88.0, 53.0..59.0, skipKillTime = 3080),
82.0..88.0, 53.0..59.0, skipKillTime = 62),

Green(Vec3(27.0, 14.0, 94.0), AxisAlignedBB(7.0, 8.0, 80.0, 37.0, 28.0, 110.0),'a', Color.GREEN,
23.0..29.0, 91.0..97.0, skipKillTime = 2600),
23.0..29.0, 91.0..97.0, skipKillTime = 52),

Blue(Vec3(84.0, 14.0, 94.0), AxisAlignedBB(71.5, 16.0, 82.5, 96.5, 26.0, 107.5),'b', Color.BLUE,
82.0..88.0, 91.0..97.0, skipKillTime = 1920),
82.0..88.0, 91.0..97.0, skipKillTime = 39),

Purple(Vec3(56.0, 14.0, 125.0), AxisAlignedBB(45.5, 13.0, 113.5,68.5, 23.0, 136.5),'5', Color.PURPLE,
53.0..59.0, 122.0..128.0, skipKillTime = 1900),
53.0..59.0, 122.0..128.0, skipKillTime = 38),

None(Vec3(0.0, 0.0, 0.0), AxisAlignedBB(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 'f', Color.WHITE,
0.0..0.0, 0.0..0.0);
Expand Down Expand Up @@ -93,9 +93,7 @@ enum class WitherDragonsEnum (
}

fun updateEntity(entityId: Int) {
val dragon = mc.theWorld.getEntityByID(entityId) as? EntityDragon ?: return
entity = dragon
dragonEntityList.add(dragon)
dragonEntityList.add(mc.theWorld.getEntityByID(entityId) as? EntityDragon ?: return)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import me.odinmain.features.impl.floor7.KingRelics.relicsOnWorldLast
import me.odinmain.features.settings.Setting.Companion.withDependency
import me.odinmain.features.settings.impl.*
import me.odinmain.utils.render.*
import me.odinmain.utils.runIn
import me.odinmain.utils.skyblock.dungeon.DungeonUtils
import me.odinmain.utils.skyblock.dungeon.M7Phases
import me.odinmain.utils.skyblock.modMessage
Expand All @@ -26,7 +27,6 @@ import net.minecraft.network.play.server.*
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.*
import kotlin.concurrent.schedule

object WitherDragons : Module(
name = "Wither Dragons",
Expand Down Expand Up @@ -80,7 +80,7 @@ object WitherDragons : Module(
val soloDebuffOnAll by BooleanSetting("Solo Debuff on All Splits", true, description = "Same as Purple Solo Debuff but for all dragons (A will only have 1 debuff).").withDependency { dragonPriorityToggle && dragonPriorityDropDown }
val paulBuff by BooleanSetting("Paul Buff", false, description = "Multiplies the power in your run by 1.25.").withDependency { dragonPriorityToggle && dragonPriorityDropDown }

val colors = arrayListOf("Green", "Purple", "Blue", "Orange", "Red")
private val colors = arrayListOf("Green", "Purple", "Blue", "Orange", "Red")
private val relicDropDown by DropdownSetting("Relics Dropdown")
val relicAnnounce by BooleanSetting("Relic Announce", false, description = "Announce your relic to the rest of the party.").withDependency { relicDropDown }
val selected by SelectorSetting("Color", "Green", colors, description = "The color of your relic.").withDependency { relicAnnounce && relicDropDown}
Expand Down Expand Up @@ -162,11 +162,10 @@ object WitherDragons : Module(
fun arrowSpawn(dragon: WitherDragonsEnum) {
if (priorityDragon == WitherDragonsEnum.None || dragon != priorityDragon) return
arrowsHit = 0
Timer().schedule(dragon.skipKillTime) {
if (dragon.entity?.isEntityAlive == true || arrowsHit > 0) {
modMessage("§fYou hit §6${arrowsHit} §farrows on §${dragon.colorCode}${dragon.name}${if (dragon.entity?.isEntityAlive == true) " §fin §c${String.format(Locale.US, "%.2f", dragon.skipKillTime.toFloat()/1000)} §fSeconds." else "."}")
arrowsHit = 0
}
runIn(dragon.skipKillTime) {
if (dragon.entity?.isEntityAlive != true && arrowsHit <= 0) return@runIn
modMessage("§fYou hit §6${arrowsHit} §farrows on §${dragon.colorCode}${dragon.name}${if (dragon.entity?.isEntityAlive == true) " §fin §c${String.format(Locale.US, "%.2f", dragon.skipKillTime.toFloat()/1000)} §fSeconds." else "."}")
arrowsHit = 0
}
}
}

0 comments on commit 8b9d287

Please sign in to comment.