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 + Backend: Gift Profit Tracker #3072

Open
wants to merge 5 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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,34 @@
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;

public class GiftTrackerConfig {

@Expose
@ConfigOption(name = "Enabled", desc = "Enable the gift profit tracker.")
@ConfigEditorBoolean
public boolean enabled = 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
public String note = "";

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

@Expose
@ConfigLink(owner = GiftTrackerConfig.class, field = "enabled")
public Position position = new Position(-274, 0, false, true);
}
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 {

@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.")
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 @@ -31,6 +31,7 @@
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;
Expand Down Expand Up @@ -885,4 +886,7 @@ public int hashCode() {
);
}
}

@Expose
public GiftProfitTracker.Data giftProfitTracker = new GiftProfitTracker.Data();
}
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 @@ -311,37 +312,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