Skip to content

Commit aeb1d4a

Browse files
committed
removed skycrypt api backend since it got removed
added release name and notes to check update message some backend adjustments
1 parent 60a31f2 commit aeb1d4a

File tree

17 files changed

+269
-268
lines changed

17 files changed

+269
-268
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx2g
33
baseGroup = com.github.subat0m1c.hatecheaters
44
mcVersion = 1.8.9
55
modid = hatecheaters
6-
version = 0.1.5
6+
version = 0.1.6
77
requiredOdin = Odin-1.2.5.beta17.jar
88
odinRepository = OdTheKing/Odin

src/main/kotlin/com/github/subat0m1c/hatecheaters/commands/impl/DevCommand.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ import com.github.stivais.commodore.Commodore
44
import com.github.stivais.commodore.utils.GreedyString
55
import com.github.subat0m1c.hatecheaters.HateCheaters.Companion.launch
66
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
7+
import com.github.subat0m1c.hatecheaters.utils.CheckUpdate
78
import com.github.subat0m1c.hatecheaters.utils.WebUtils.testQue
89
import com.github.subat0m1c.hatecheaters.utils.apiutils.ParseUtils.getSkyblockProfile
910
import net.minecraft.client.gui.GuiScreen
1011

1112
val DevCommand = Commodore("hcdev") {
1213

14+
literal("checkupdate").runs {
15+
modMessage("Checking for updates...")
16+
CheckUpdate.lookForUpdates()
17+
}
18+
1319
literal("apitest") {
14-
runs { name: String, skipCache: Boolean?, forceSkycrypt: Boolean? ->
20+
runs { name: String, skipCache: Boolean? ->
1521
launch {
16-
getSkyblockProfile(name, skipCache ?: false, forceSkycrypt ?: false)
22+
getSkyblockProfile(name, skipCache ?: false)
1723
.getOrElse { return@launch modMessage(it.message) }.memberData ?: return@launch modMessage("Could not find player data.")
1824
modMessage("Succeeded!")
1925
}

src/main/kotlin/com/github/subat0m1c/hatecheaters/commands/impl/StatsCommand.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package com.github.subat0m1c.hatecheaters.commands.impl
22

33
import com.github.stivais.commodore.Commodore
44
import com.github.subat0m1c.hatecheaters.HateCheaters.Companion.launch
5-
import com.github.subat0m1c.hatecheaters.modules.BetterPartyFinder.displayDungeonData
65
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
6+
import com.github.subat0m1c.hatecheaters.utils.DungeonStats.displayDungeonData
77
import com.github.subat0m1c.hatecheaters.utils.apiutils.ParseUtils.getSkyblockProfile
88
import me.odinmain.OdinMain.mc
99
import me.odinmain.utils.containsOneOf
@@ -15,11 +15,15 @@ val StatsCommand = Commodore("hcs", "ds", "hcstats") {
1515
suggests { mc.netHandler.playerInfoMap.mapNotNull { it.gameProfile.name.lowercase().takeUnless { it.containsOneOf("!", " ") } } }
1616
}
1717

18-
runs { name: String? ->
18+
param("floor") {
19+
suggests { setOf("1", "2", "3", "4", "5", "6", "7") }
20+
}
21+
22+
runs { name: String?, floor: Int? ->
1923
val ign = name ?: mc.thePlayer.name
2024
launch {
2125
val profiles = getSkyblockProfile(ign).getOrElse { return@launch modMessage(it.message) }
22-
profiles.memberData?.let { displayDungeonData(it, profiles.name) }
26+
profiles.memberData?.let { displayDungeonData(it, profiles.name, floor = floor ?: 7) }
2327
?: return@launch modMessage("""
2428
${getChatBreak()}
2529
Could not find info for player $ign
Lines changed: 5 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
package com.github.subat0m1c.hatecheaters.modules
22

33
import com.github.subat0m1c.hatecheaters.HateCheaters.Companion.launch
4+
import com.github.subat0m1c.hatecheaters.utils.DungeonStats.displayDungeonData
45
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.formatted
5-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.capitalizeWords
6-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.chatConstructor
7-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorStat
8-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorize
96
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
107
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.secondsToMinutes
8+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.witherImpactRegex
119
import com.github.subat0m1c.hatecheaters.utils.LogHandler.Logger
12-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.colorName
13-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.maxMagicalPower
14-
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData
15-
import com.github.subat0m1c.hatecheaters.utils.apiutils.LevelUtils.cataLevel
16-
import com.github.subat0m1c.hatecheaters.utils.apiutils.LevelUtils.classAverage
17-
import com.github.subat0m1c.hatecheaters.utils.apiutils.LevelUtils.classLevel
1810
import com.github.subat0m1c.hatecheaters.utils.apiutils.ParseUtils.getSkyblockProfile
1911
import me.odinmain.features.Category
2012
import me.odinmain.features.Module
@@ -24,11 +16,10 @@ import me.odinmain.utils.*
2416
import me.odinmain.utils.skyblock.*
2517
import me.odinmain.utils.skyblock.PlayerUtils.alert
2618
import kotlin.collections.HashSet
27-
import kotlin.math.ceil
2819

2920
object BetterPartyFinder : Module(
3021
name = "Better Party Finder",
31-
description = "Provides stats when a player joins your party. Includes autokick functionality. /hcitems to configure important items list.sk",
22+
description = "Provides stats when a player joins your party. Includes autokick functionality. /hcitems to configure important items list.",
3223
category = Category.DUNGEON
3324
) {
3425
private val fullPartyNotification by BooleanSetting("Full Party Notification", default = true, description = "Notifies you when your party is full.")
@@ -90,7 +81,7 @@ object BetterPartyFinder : Module(
9081
val profiles = getSkyblockProfile(name).getOrElse { return@launch modMessage(it.message) }
9182
profiles.profileData.profiles
9283
.find { it.selected }?.members?.get(profiles.uuid)
93-
?.let { displayDungeonData(it, profiles.name) }
84+
?.let { displayDungeonData(it, profiles.name, petMap.keys, floor) }
9485
?: return@launch modMessage("""
9586
${getChatBreak()}
9687
Could not find info for player $name
@@ -103,7 +94,6 @@ object BetterPartyFinder : Module(
10394

10495
onMessage(pfRegex, { enabled && autokicktoggle}) {
10596
val name = it.groupValues[1].takeUnless { it == mc.session.username } ?: return@onMessage
106-
10797
Logger.info("$name is being searched")
10898

10999
if (kickedList.contains(name) && kickCache) {
@@ -171,124 +161,12 @@ object BetterPartyFinder : Module(
171161
return@launch modMessage("Kicking $name for: \n${kickedReasons.joinToString(" \n")}")
172162
}
173163

174-
displayDungeonData(currentProfile, profiles.name)
164+
displayDungeonData(currentProfile, profiles.name, petMap.keys, floor)
175165
}
176166
}
177167

178168
onMessage(kickRegex, { kickCache && enabled }) { message ->
179169
message.groupValues[1].takeUnless { name -> kickedList.contains(name) }?.let { name -> kickedList.add(name) }
180170
}
181171
}
182-
183-
private val witherImpactRegex = Regex("(?:⦾ )?Ability: Wither Impact {2}RIGHT CLICK")
184-
185-
fun displayDungeonData(currentProfile: HypixelData.MemberData, name: String) {
186-
val catacombs = currentProfile.dungeons
187-
188-
val profileKills = currentProfile.playerStats.kills
189-
190-
val fpbs = (1..7).map { it to catacombs.dungeonTypes.catacombs.fastestTimeSPlus[it.toString()] }
191-
val mmpbs = (1..7).map { it to catacombs.dungeonTypes.mastermode.fastestTimeSPlus[it.toString()] }
192-
193-
val allItems = currentProfile.allItems
194-
195-
val armor = currentProfile.inventory.invArmor.itemStacks.filterNotNull().reversed()
196-
197-
val pets = buildMap {
198-
currentProfile.pets.pets.forEachIndexed { i, pet ->
199-
if (pet.type in petMap.keys) put(pet.colorName, pet.heldItem?.formatted)
200-
}
201-
}
202-
203-
val items = importantItems.toSet().map { Pair(it, it.replace(" ", "_").uppercase() in allItems.map { it.skyblockID } ) }
204-
205-
val mmComps = (catacombs.dungeonTypes.mastermode.tierComps.toMutableMap().apply { this.remove("total") }).values.sum()
206-
val floorComps = (catacombs.dungeonTypes.catacombs.tierComps.toMutableMap().apply { this.remove("total") }).values.sum()
207-
208-
val hype = allItems.find { it?.lore?.any { it.noControlCodes.matches(witherImpactRegex) } == true }
209-
210-
val tunings = currentProfile.accessoryBagStorage.tuning.currentTunings.map { "${it.key.replace("_", " ").capitalizeWords().colorStat}§7: ${it.value.colorize(ceil(currentProfile.magicalPower /10.0))}" }
211-
212-
chatConstructor {
213-
displayText(getChatBreak())
214-
215-
clickText(
216-
"\n§3| §2Player: §b$name",
217-
"/pv $name",
218-
listOf("§e§lCLICK §r§ato open profile viewer for §b$name")
219-
)
220-
221-
displayText("\n§3| §4Cata Level: §f${catacombs.dungeonTypes.cataLevel.round(2).colorize(50)} §8: ")
222-
223-
hoverText(
224-
"§dClass Avg: §6${catacombs.classAverage.round(2).colorize(50)}\n",
225-
catacombs.classes.entries.map { "§e${it.key.capitalizeFirst()} §7| ${it.value.classLevel.round(2).colorize(50)}" }
226-
)
227-
228-
displayText("""
229-
§3| §bSecrets: §f${catacombs.secrets.colorize(100000)} §8: §bAverage: §f${(catacombs.secrets.toDouble()/(mmComps + floorComps)).round(2).colorize(15.0)}
230-
§3| §cBlood mobs: §f${(profileKills["watcher_summon_undead"] ?: 0) + (profileKills["master_watcher_summon_undead"] ?: 0)}
231-
""".trimIndent()
232-
)
233-
234-
displayText()
235-
236-
if (currentProfile.inventoryApi) {
237-
hoverText(
238-
"\n§3| §5Magical Power: §f${currentProfile.magicalPower.colorize(maxMagicalPower)}",
239-
listOf("Tunings: ") + tunings
240-
)
241-
242-
displayText()
243-
244-
hype?.let {
245-
hoverText("\n§3| §5Wither Impact: §l§2Found!", (listOf(it.displayName) + it.lore))
246-
} ?: displayText("\n§3| §5Wither Impact: §o§4Missing!")
247-
} else {
248-
hoverText(
249-
"\n§3| §5Assumed Magical Power: ${currentProfile.assumedMagicalPower.colorize(maxMagicalPower)}",
250-
listOf("Assumed using the following tunings:") + tunings
251-
)
252-
253-
displayText()
254-
255-
displayText("\n§3| §o§4Inventory API Disabled!")
256-
}
257-
258-
displayText()
259-
260-
armor.forEach {
261-
hoverText(
262-
"\n§3| ${it.displayName}",
263-
(listOf(it.displayName) + it.lore)
264-
)
265-
}
266-
267-
if (armor.isNotEmpty()) displayText()
268-
269-
if (pets.isNotEmpty()) { // this isnt string built to allow different hover texts
270-
displayText("\n§3| ")
271-
pets.entries.forEachIndexed { i, (pet, item) ->
272-
hoverText("${pet}${if (i != pets.entries.size - 1) ", " else "\n"}", listOf("§7Held Item: ${item ?: "§o§4None!"}"))
273-
}
274-
}
275-
276-
hoverText(
277-
"\n§3| §7Personal Bests §e§lHOVER §7(F${floor}: ${fpbs.getSafe(floor-1)?.second?.let { secondsToMinutes(it * 0.001) } ?: "§o§4None!"})",
278-
fpbs.map { "§aFloor ${it.first} §7| §2${it.second?.let { secondsToMinutes(it * 0.001) } ?: "§o§4None!"}" }
279-
)
280-
281-
hoverText(
282-
"\n§3| §4§lMM §8Personal Bests §e§lHOVER §7(M${floor}: ${mmpbs.getSafe(floor-1)?.second?.let { secondsToMinutes(it * 0.001) } ?: "§o§4None!"})",
283-
mmpbs.map { "§cFloor ${it.first} §7| §2${it.second?.let { secondsToMinutes(it * 0.001) } ?: "§o§4None!"}" }
284-
)
285-
286-
if (importantItems.isNotEmpty() && allItems.isNotEmpty()) hoverText(
287-
"\n\n§3| §5Important Items §e§lHOVER",
288-
items.map { "§b${it.first.capitalizeWords()} §7-> ${if (it.second) "§a✔" else "§4§l✖"}" }
289-
)
290-
291-
displayText(getChatBreak())
292-
}.print()
293-
}
294172
}

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/HateCheatersModule.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object HateCheatersModule : Module(
1717
) {
1818
val logJson by BooleanSetting("Log Json", default = false, description = "Logs requested json data to Config/hatecheaters/json_logs")
1919
val debugMessages by BooleanSetting("Debug messages", default = false, description = "Prints debug messages in your chat instead of needing to open logs.")
20-
val checkUpdates by BooleanSetting("Update Checker", default = true, description = "Checks GitHub for latest HateCheaters releases and notifies you if you are on an old version!")
20+
private val checkUpdates by BooleanSetting("Update Checker", default = true, description = "Checks GitHub for latest HateCheaters releases and notifies you if you are on an old version!")
2121
val server by StringSetting("Api Server", default = "default", hidden = false, description = "Server to be used to connect to the api. set to \"default\" to use the default. Only change if you know what you're doing. format: \"subdomain.domain.tld\"")
2222

2323
private var checkedForUpdate = false
@@ -27,9 +27,7 @@ object HateCheatersModule : Module(
2727
if (checkedForUpdate || !checkUpdates) destroyExecutor()
2828
if (!LocationUtils.isInSkyblock) return@execute
2929
checkedForUpdate = true
30-
launch {
31-
CheckUpdate.lookForUpdates()
32-
}
30+
CheckUpdate.lookForUpdates()
3331
}
3432
}
3533
}

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Inventory.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.fixFirstNine
1010
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.getSubset
1111
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.insertItemsAtIndexes
1212
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.capitalizeWords
13-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorStat
1413
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorize
1514
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.getMagicalPower
1615
import me.odinmain.utils.render.*
@@ -143,7 +142,7 @@ object Inventory: Pages.PVPage("Inventory") {
143142
private val talis by profileLazy { profile.inventory.bagContents["talisman_bag"]?.itemStacks?.filterNotNull()?.sortedByDescending { it.getMagicalPower } ?: emptyList() }
144143
private val magicPower by profileLazy { profile.magicalPower }
145144
private val mp by profileLazy { "§aSelected Power: §6${profile.accessoryBagStorage.selectedPower?.capitalizeWords() ?: "§cNone!"}" }
146-
private val tunings by profileLazy { profile.accessoryBagStorage.tuning.currentTunings.map { "${it.key.replace("_", " ").capitalizeWords().colorStat}§7: ${it.value.colorize(ceil(magicPower/10.0))}" } }
145+
private val tunings by profileLazy { profile.tunings }
147146
private val abiPhone by profileLazy { "§5Abicase: ${floor(profile.crimsonIsle.abiphone.activeContacts.size/2.0).toInt()}" }
148147
private val riftPrism by profileLazy { "§dRift Prism: ${ if (profile.rift.access.consumedPrism) "§aObtained" else "§cMissing"}" }
149148

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Overview.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorize
1515
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.colorizeNumber
1616
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.commas
1717
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.mcWidth
18-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.colorName
19-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.maxMagicalPower
20-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.petItem
18+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.colorName
19+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.maxMagicalPower
20+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.petItem
2121
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.PlayerInfo
2222
import com.github.subat0m1c.hatecheaters.utils.apiutils.LevelUtils.cappedSkillAverage
2323
import com.github.subat0m1c.hatecheaters.utils.apiutils.LevelUtils.cataLevel
@@ -58,9 +58,6 @@ object Overview: Pages.PVPage("Overview") {
5858
}
5959
}
6060

61-
private const val SKYCRYPT_TEXT = "Skycrypt cache only!"
62-
private val skycryptPosition = lineY + mainHeight - (getMCTextHeight() * 2.5) / 2
63-
6461
private val data: List<String> by profileLazy {
6562
val mmComps = profile.dungeons.dungeonTypes.mastermode.tierComps.without("total").values.sum()
6663
val floorComps = profile.dungeons.dungeonTypes.catacombs.tierComps.without("total").values.sum()
@@ -93,8 +90,6 @@ object Overview: Pages.PVPage("Overview") {
9390
}
9491

9592
playerEntity?.let { drawPlayerOnScreen(playerX.toDouble(), lineY + mainHeight / 2.0 + 175, 175, Mouse.getX() + 325, Mouse.getY() - 225, it) }
96-
97-
if (player.skyCrypt) centeredText(SKYCRYPT_TEXT, mainCenterX, skycryptPosition, 2.5, Color.RED)
9893
dropDown.draw()
9994
}
10095

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Pets.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import com.github.subat0m1c.hatecheaters.pvgui.v2.Pages.playClickSound
66
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.getSubset
77
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.buttons
88
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.profileLazy
9-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.colorName
10-
import com.github.subat0m1c.hatecheaters.utils.apiutils.DataUtils.petItem
9+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.colorName
10+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.petItem
1111
import me.odinmain.utils.render.Box
1212
import me.odinmain.utils.render.roundedRectangle
1313
import kotlin.math.ceil

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Test.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ package com.github.subat0m1c.hatecheaters.pvgui.v2.pages
22

33
import com.github.subat0m1c.hatecheaters.modules.ProfileViewer
44
import com.github.subat0m1c.hatecheaters.pvgui.v2.Pages
5-
import com.github.subat0m1c.hatecheaters.pvgui.v2.pages.Inventory.invArmor
65
import com.github.subat0m1c.hatecheaters.pvgui.v2.pages.Inventory.separatorLineY
76
import com.github.subat0m1c.hatecheaters.pvgui.v2.pages.Inventory.startY
87
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.GridItems
9-
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.fixFirstNine
108
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.itemGrid
119
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.profileLazy
10+
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.capitalizeWords
11+
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.createCustomSkull
1212
import me.odinmain.utils.render.Color
1313

1414
object Test : Pages.PVPage("Test") {
1515
private val centerY by lazy { startY + (mainHeight - ((separatorLineY)))/2 }
1616
private val inventory by profileLazy {
1717
GridItems(
18-
invArmor.reversed() + listOf(null) + profile.inventory.equipment.itemStacks + fixFirstNine(profile.inventory.invContents.itemStacks),
19-
mainX, centerY.toInt(), mainWidth, 9
18+
listOf(createCustomSkull("§aSelected Power: §6${profile.accessoryBagStorage.selectedPower?.capitalizeWords() ?: "§cNone!"}", profile.tunings, TALISMAN_BAG_TEXTURE, profile.magicalPower)),
19+
mainX, centerY.toInt(), mainWidth, 1
2020
)
2121
}
2222
private val test by profileLazy {
@@ -27,12 +27,12 @@ object Test : Pages.PVPage("Test") {
2727
lineY.toFloat(),
2828
) {
2929
colorHandler { i, _ ->
30-
if (i == 4) Color.TRANSPARENT else ProfileViewer.currentTheme.items
30+
Color.TRANSPARENT
3131
}
3232
}
3333
}
3434

35-
override fun draw() {
36-
test.draw(mouseX.toInt(), mouseY.toInt())
37-
}
35+
const val TALISMAN_BAG_TEXTURE = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGIyNDllODhhZmEzMGZjODM3YjgyMTczYTMwNDgzNDU4ZDRlOWEzM2M3ZWMyNWU1NTEzODdlOGU1NGEwMThhZSJ9fX0="
36+
37+
override fun draw() = test.draw(mouseX.toInt(), mouseY.toInt())
3838
}

0 commit comments

Comments
 (0)