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

Feature: Gift Profit Tracker #3072

Open
wants to merge 43 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
533055b
Done (I think)
DavidArthurCole Dec 16, 2024
9a71cca
Should probably add types, yeah
DavidArthurCole Dec 16, 2024
58dd7fb
Fix a couple problems
DavidArthurCole Dec 16, 2024
3e2cd49
Okay, now done
DavidArthurCole Dec 16, 2024
6357088
Fin
DavidArthurCole Dec 16, 2024
73d4695
Attempt to pre-solve for Party gifts
DavidArthurCole Dec 16, 2024
50d75ab
Better add method
DavidArthurCole Dec 19, 2024
c79aec7
Formatting
DavidArthurCole Dec 19, 2024
2102075
Merge branch 'hannibal002:beta' into GiftTracker
DavidArthurCole Dec 20, 2024
a4c9450
Merge
DavidArthurCole Jan 4, 2025
0bd8f5e
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/GiftTracker
CalMWolfs Jan 8, 2025
798974c
Merge
DavidArthurCole Jan 9, 2025
ebcf04a
Merge remote-tracking branch 'upstream/beta' into GiftTracker
DavidArthurCole Jan 9, 2025
46611db
Port config
DavidArthurCole Jan 9, 2025
bd3182a
Merge branch 'beta' into GiftTracker
CalMWolfs Jan 10, 2025
bb75f1d
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/GiftTracker
CalMWolfs Jan 12, 2025
49934c1
regression
CalMWolfs Jan 12, 2025
995740e
Merge branch 'beta' into GiftTracker
DavidArthurCole Jan 14, 2025
726b3e3
Merge branch 'beta' into GiftTracker
CalMWolfs Jan 16, 2025
72882c8
Merge
DavidArthurCole Jan 20, 2025
7d93755
Fix
DavidArthurCole Jan 20, 2025
a3a2f43
Merge
DavidArthurCole Jan 22, 2025
58c2bc3
Merge branch 'beta' into GiftTracker
DavidArthurCole Jan 22, 2025
352a83d
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/GiftTracker
CalMWolfs Jan 24, 2025
4d8c653
Merge
DavidArthurCole Jan 24, 2025
f2ef4aa
Import
DavidArthurCole Jan 24, 2025
bc16aaf
Merge branch 'beta' into GiftTracker
DavidArthurCole Jan 24, 2025
bdd75e2
Merge
DavidArthurCole Jan 24, 2025
a9d5e73
Merge branch 'beta' into GiftTracker
DavidArthurCole Jan 24, 2025
98b53ba
Merge
DavidArthurCole Jan 25, 2025
8f406a6
Cleanup
DavidArthurCole Jan 25, 2025
9ad52e7
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/GiftTracker
hannibal002 Jan 25, 2025
89ab441
Merge remote-tracking branch 'upstream/beta' into GiftTracker
DavidArthurCole Jan 25, 2025
33a408d
Merge remote-tracking branch 'upstream/beta' into GiftTracker
DavidArthurCole Jan 31, 2025
b398a1d
Merge branch 'beta' into GiftTracker
DavidArthurCole Feb 1, 2025
da6f854
Merge branch 'beta' into GiftTracker
DavidArthurCole Feb 10, 2025
d18795d
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/GiftTracker
hannibal002 Feb 11, 2025
20d69c5
merge conflict
hannibal002 Feb 11, 2025
82b6cd8
code cleanup
hannibal002 Feb 11, 2025
5edd2df
added searchable support
hannibal002 Feb 11, 2025
2682680
Merge remote-tracking branch 'upstream/beta' into GiftTracker
DavidArthurCole Feb 11, 2025
5124b56
Cleanup
DavidArthurCole Feb 11, 2025
997a15b
Merge remote-tracking branch 'upstream/beta' into GiftTracker
DavidArthurCole Feb 11, 2025
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 @@ -3,6 +3,7 @@
import at.hannibal2.skyhanni.config.features.event.bingo.BingoConfig;
import at.hannibal2.skyhanni.config.features.event.carnival.CarnivalConfig;
import at.hannibal2.skyhanni.config.features.event.diana.DianaConfig;
import at.hannibal2.skyhanni.config.features.event.gifting.GiftingConfig;
import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityEggsConfig;
import at.hannibal2.skyhanni.config.features.event.waypoints.LobbyWaypointsConfig;
import at.hannibal2.skyhanni.config.features.event.winter.WinterConfig;
Expand All @@ -25,6 +26,10 @@ public class EventConfig {
@Expose
public WinterConfig winter = new WinterConfig();

@Category(name = "Gifting", desc = "Giving and receiving gifts")
@Expose
public GiftingConfig gifting = new GiftingConfig();

@Expose
@Category(name = "Hoppity Eggs", desc = "Features for the Hoppity event that happens every SkyBlock spring.")
public HoppityEggsConfig hoppityEggs = new HoppityEggsConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package at.hannibal2.skyhanni.config.features.event.gifting

import at.hannibal2.skyhanni.config.core.config.Position
import com.google.gson.annotations.Expose
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorInfoText
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption

class GiftTrackerConfig {
@Expose
@ConfigOption(name = "Enabled", desc = "Enable the gift profit tracker.")
@ConfigEditorBoolean
var enabled: Boolean = false

@Expose
@ConfigOption(
name = "§cNote",
desc = "§cDue to the complexities of gifts leaving and re-entering the inventory or stash, gift usage is not auto-tracked. " +
"§cUse §e/shaddusedgifts §cto manually add gifts used."
)
@ConfigEditorInfoText
var note: String = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont use @Expose on config options annotated by @ConfigEditorInfoText


@Expose
@ConfigOption(name = "Holding Gift", desc = "Only show the tracker while holding a gift.")
@ConfigEditorBoolean
var holdingGift: Boolean = false

@Expose
@ConfigLink(owner = GiftTrackerConfig::class, field = "enabled")
var position: Position = Position(-274, 0)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package at.hannibal2.skyhanni.config.features.event.gifting;

import at.hannibal2.skyhanni.config.features.event.winter.GiftingOpportunitiesConfig;
import at.hannibal2.skyhanni.config.features.event.winter.UniqueGiftConfig;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;

public class GiftingConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this config file be made in kotlin?


@Expose
@ConfigOption(name = "Gift Profit Tracker", desc = "")
@Accordion
public GiftTrackerConfig giftProfitTracker = new GiftTrackerConfig();

@Expose
@ConfigOption(name = "Unique Gifting Opportunities", desc = "Highlight players who you haven't given gifts to yet.")
@Accordion
public GiftingOpportunitiesConfig giftingOpportunities = new GiftingOpportunitiesConfig();

@Accordion
@Expose
@ConfigOption(name = "Unique Gift Counter", desc = "Keep track of how many unique players you have given gifts to.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order the annotations here the same way and put @Accordion after ConfigOption

public UniqueGiftConfig uniqueGiftCounter = new UniqueGiftConfig();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ public class WinterConfig {
@Accordion
public FrozenTreasureConfig frozenTreasureTracker = new FrozenTreasureConfig();

@Accordion
@Expose
@ConfigOption(name = "Unique Gifting Opportunities", desc = "Highlight players who you haven't given gifts to yet.")
public GiftingOpportunitiesConfig giftingOpportunities = new GiftingOpportunitiesConfig();

@Accordion
@Expose
@ConfigOption(name = "Unique Gift Counter", desc = "Keep track of how many unique players you have given gifts to.")
public UniqueGiftConfig uniqueGiftCounter = new UniqueGiftConfig();

@Accordion
@Expose
@ConfigOption(name = "Refined Bottle of Jyrre Timer", desc = "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems
import at.hannibal2.skyhanni.features.garden.pests.PestProfitTracker
import at.hannibal2.skyhanni.features.garden.pests.VinylType
import at.hannibal2.skyhanni.features.garden.visitor.VisitorReward
import at.hannibal2.skyhanni.features.gifting.GiftProfitTracker
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryStrayTracker
import at.hannibal2.skyhanni.features.inventory.experimentationtable.ExperimentsProfitTracker
import at.hannibal2.skyhanni.features.inventory.wardrobe.WardrobeApi.WardrobeData
Expand Down Expand Up @@ -172,6 +173,9 @@ class ProfileSpecificStorage {
@Expose
var frozenTreasureTracker: FrozenTreasureTracker.Data = FrozenTreasureTracker.Data()

@Expose
var giftProfitTracker: GiftProfitTracker.Data = GiftProfitTracker.Data()

// -- hoppity
@Expose
var chocolateFactory: ChocolateFactoryStorage = ChocolateFactoryStorage()
Expand Down
45 changes: 14 additions & 31 deletions src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.features.chat.PowderMiningChatFilter.genericMiningR
import at.hannibal2.skyhanni.features.dungeon.DungeonApi
import at.hannibal2.skyhanni.features.garden.GardenApi
import at.hannibal2.skyhanni.features.garden.pests.PestApi
import at.hannibal2.skyhanni.features.gifting.GiftProfitTracker
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RegexUtils.groupOrEmpty
Expand Down Expand Up @@ -313,37 +314,19 @@ object ChatFilter {
)

// Winter Gift
private val winterGiftPatterns = listOf(
// winter gifts useless
"§f§lCOMMON! §r§3.* XP §r§egift with §r.*§r§e!".toPattern(),
"(§f§lCOMMON|§9§lRARE)! §r.* XP Boost .* Potion §r.*§r§e!".toPattern(),
"(§f§lCOMMON|§9§lRARE)! §r§6.* coins §r§egift with §r.*§r§e!".toPattern(),

// enchanted book
"§9§lRARE! §r§9Scavenger IV §r§egift with §r.*§r§e!".toPattern(),
"§9§lRARE! §r§9Looting IV §r§egift with §r.*§r§e!".toPattern(),
"§9§lRARE! §r§9Luck VI §r§egift with §r.*§r§e!".toPattern(),

// minion skin
"§e§lSWEET! §r§f(Grinch|Santa|Gingerbread Man) Minion Skin §r§egift with §r.*§r§e!".toPattern(),

// rune
"§9§lRARE! §r§f◆ Ice Rune §r§egift with §r.*§r§e!".toPattern(),

// furniture
"§e§lSWEET! §r§fTall Holiday Tree §r§egift with §r.*§r§e!".toPattern(),
"§e§lSWEET! §r§fNutcracker §r§egift with §r.*§r§e!".toPattern(),
"§e§lSWEET! §r§fPresent Stack §r§egift with §r.*§r§e!".toPattern(),

"§e§lSWEET! §r§9(Winter|Battle) Disc §r§egift with §r.*§r§e!".toPattern(),

// winter gifts a bit useful
"§e§lSWEET! §r§9Winter Sack §r§egift with §r.*§r§e!".toPattern(),
"§e§lSWEET! §r§5Snow Suit .* §r§egift with §r.*§r§e!".toPattern(),

// winter gifts not your gifts
"§cThis gift is for §r.*§r§c, sorry!".toPattern(),
)
private val winterGiftPatterns = buildList {
GiftProfitTracker.run {
listOf(
xpGainedPattern,
coinsGainedPattern,
northStarsPattern,
boostPotionPattern,
enchantmentBookPattern,
genericRewardPattern
).forEach { add(it) }
}
addAll(GiftProfitTracker.spamPatterns)
}

private val fireSalePattern by RepoPattern.pattern(
"chat.firesale",
Expand Down
Loading
Loading