Skip to content

Commit

Permalink
Added built in block wrong clicks in rubix to CustomTermGui
Browse files Browse the repository at this point in the history
  • Loading branch information
odtheking committed Oct 25, 2024
1 parent 1fb1e4f commit 07ce37c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ object QueueTerms : Module(
if ((TerminalSolver.currentTerm.type == TerminalTypes.ORDER && slot != TerminalSolver.currentTerm.solution.first()) || TerminalSolver.renderType == 3) return
if (slot in previouslyClicked) return modMessage("Already clicked slot $slot")
if (TerminalSolver.currentTerm.type == TerminalTypes.RUBIX) {
if ((TerminalSolver.currentTerm.solution.count { it == slot } < 3 && button != 0) ||
(TerminalSolver.currentTerm.solution.count { it == slot } >= 3 && button != 1)) return modMessage("Wrong button for this slot")
if (TerminalSolver.currentTerm.solution.count { it == slot }.equalsOneOf(1, 4)) previouslyClicked += slot
} else previouslyClicked += slot
queue.takeIf { it.count { click -> click.slot == slot } < 2 }?.add(Click(slot = slot, mode = mode, button = button))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import me.odinmain.features.settings.impl.BooleanSetting
import me.odinmain.features.settings.impl.NumberSetting
import me.odinmain.utils.skyblock.Island
import me.odinmain.utils.skyblock.LocationUtils
import me.odinmain.utils.skyblock.LocationUtils.inSkyblock
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.init.Blocks
import net.minecraft.init.Items
Expand Down Expand Up @@ -61,12 +60,13 @@ object AutoExperiments : Module(
*/
@SubscribeEvent
fun onGuiDraw(event: GuiEvent.DrawGuiContainerScreenEvent) {
if (!inSkyblock) return
val invSlots = ((event.gui as? GuiChest)?.inventorySlots as? ContainerChest)?.inventorySlots?.takeIf { it.size >= 54 } ?: return
when (currentExperiment) {
ExperimentType.CHRONOMATRON -> solveChronomatron(invSlots)
ExperimentType.ULTRASEQUENCER -> solveUltraSequencer(invSlots)
else -> return
if (!LocationUtils.currentArea.isArea(Island.PrivateIsland)) return
((event.gui as? GuiChest)?.inventorySlots as? ContainerChest)?.inventorySlots?.takeIf { it.size >= 54 }?.let {
when (currentExperiment) {
ExperimentType.CHRONOMATRON -> solveChronomatron(it)
ExperimentType.ULTRASEQUENCER -> solveUltraSequencer(it)
else -> return
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ abstract class TermGui {
itemIndexMap.entries.find { it.value.isPointWithin(x, y) }?.let {
if (System.currentTimeMillis() - currentTerm.timeOpened < 300) return
if (GuiEvent.CustomTermGuiClick(it.key, if (button == 0) 3 else 0, button).postAndCatch()) return
val needed = currentTerm.solution.count { slot -> slot == it.key }
if (currentTerm.type == TerminalTypes.RUBIX && ((needed < 3 && button != 0) || (needed >= 3 && button != 1))) return
windowClick(it.key, if (button == 0) PlayerUtils.ClickType.Middle else PlayerUtils.ClickType.Right, true)
}
}
Expand Down

0 comments on commit 07ce37c

Please sign in to comment.