forked from hannibal002/SkyHanni
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/at/hannibal2/skyhanni/features/misc/customscoreboard/InformationGetter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package at.hannibal2.skyhanni.features.misc.customscoreboard | ||
|
||
import at.hannibal2.skyhanni.data.PurseAPI | ||
import at.hannibal2.skyhanni.data.ScoreboardData | ||
import at.hannibal2.skyhanni.utils.LorenzUtils | ||
import at.hannibal2.skyhanni.utils.TabListData | ||
|
||
class InformationGetter { | ||
fun getInformation(){ | ||
// Resets Party count | ||
partyCount = 0 | ||
|
||
// Gets some values from the tablist | ||
for (line in TabListData.getTabList()) { | ||
when { | ||
line.startsWith(" Gems: §r§a") -> gems = line.removePrefix(" Gems: §r§a") | ||
line.startsWith(" Bank: §r§6") -> bank = line.removePrefix(" Bank: §r§6") | ||
line.startsWith(" §r§fMithril Powder: §r§2") -> mithrilPowder = | ||
line.removePrefix(" §r§fMithril Powder: §r§2") | ||
line.startsWith(" §r§fGemstone Powder: §r§d") -> gemstonePowder = | ||
line.removePrefix(" §r§fGemstone Powder: §r§d") | ||
} | ||
} | ||
|
||
// Gets some values from the scoreboard | ||
for (line in ScoreboardData.sidebarLinesFormatted) { | ||
when { | ||
line.startsWith(" §7⏣ ") || line.startsWith(" §5ф ") -> location = line | ||
line.startsWith("Motes: §d") -> motes = line.removePrefix("Motes: §d") | ||
extractLobbyCode(line) is String -> lobbyCode = | ||
extractLobbyCode(line)?.substring(1) ?: "<hidden>" //removes first char (number of color code) | ||
line.startsWith("Heat: ") -> heat = line.removePrefix("Heat: ") | ||
line.startsWith("Bits: §b") -> bits = line.removePrefix("Bits: §b") | ||
line.startsWith("Copper: §c") -> copper = line.removePrefix("Copper: §c") | ||
} | ||
} | ||
purse = LorenzUtils.formatInteger(PurseAPI.currentPurse.toInt()) | ||
} | ||
} |