Skip to content

Conversation

@FlyModeZ
Copy link
Contributor

@FlyModeZ FlyModeZ commented Aug 6, 2025

thingy

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @FlyModeZ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've implemented a new "Countdowns" feature that enables users to set up custom in-game timers triggered by specific chat messages or regex patterns, with the countdowns displayed on a customizable HUD. This feature is complemented by a new command-line interface for easy management of these triggers. Additionally, I've made general improvements to utility functions, such as enhanced number formatting and list manipulation, and included minor fixes and enhancements in other modules, like preventing repetitive /locraw commands and refining dungeon score and puzzle completion message recognition.

Highlights

  • New Countdowns Feature: I've introduced a new "Countdowns" feature that allows users to create custom in-game timers. These timers can be triggered by specific chat messages or regular expressions and are displayed on a customizable HUD.
  • Command-Line Management for Countdowns: I've added a new command-line interface, "/countdowns", which provides subcommands to easily manage (add, remove, clear, list) your custom countdown triggers.
  • Enhanced ListSetting for Dynamic Data Loading: I've enhanced the ListSetting class to support a reloader function. This allows for more dynamic handling and potential transformation of list elements when they are deserialized from JSON, ensuring data consistency or updates upon loading.
  • Prevention of Repetitive /locraw Commands: I've implemented a new feature in the ChatCommands module to prevent repetitive sending of the /locraw command, which helps reduce chat spam.
  • Utility Function Improvements: I've added new utility functions for number formatting, including an overloaded toFixed function that accepts a divisor, and refactored the formatNumber functions to better handle large numbers (e.g., K, M, B, T). I also added an addOrNull extension for MutableList to prevent duplicate entries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new "Countdown" feature, which allows users to set up timers on their HUD triggered by chat messages or regex patterns. The changes are well-structured, adding a new module, a command for managing countdowns, and several utility updates. My review highlights a critical bug in the new command's index validation, a potential performance issue with how chat messages are processed, and opportunities to improve code style and readability for better maintainability.

@FlyModeZ
Copy link
Contributor Author

FlyModeZ commented Aug 6, 2025

dude
image

@FlyModeZ
Copy link
Contributor Author

FlyModeZ commented Aug 7, 2025

nvm im dumbass

Signed-off-by: FlyModeZ <[email protected]>
sendChatMessage(words.joinToString(" "))
}

@SubscribeEvent
Copy link
Owner

Choose a reason for hiding this comment

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

Odin doesn't use locraw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

skyhanni and oneconfig sending them at the same time for me

Copy link
Owner

Choose a reason for hiding this comment

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

Yea well this isn't skyhanni nor oneconfig

}
}
val countdownTriggers by ListSetting("Countdowns", mutableListOf<CountdownTrigger>()) { it.copy() }

Copy link
Owner

Choose a reason for hiding this comment

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

Don't have presets inside the mod

private set
var averagePing = 0f
private set

Copy link
Owner

Choose a reason for hiding this comment

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

Revert this

return first
}

fun <T> MutableList<T>.addOrNull(element: T): T? {
Copy link
Owner

Choose a reason for hiding this comment

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

This isn't generally used not point having it a global function

Regex("^You are not currently in a party.$")
)

var forceInParty = false
Copy link
Owner

Choose a reason for hiding this comment

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

Why is that needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if hypixel change these party messages it would break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ill revert this

}

literal("party").runs {
modMessage("${PartyUtils.isInParty}, ${PartyUtils.partyLeader}, ${PartyUtils.partyMembers}")
Copy link
Owner

Choose a reason for hiding this comment

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

Why is that needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk i didn't make these 2 lines

Copy link
Owner

Choose a reason for hiding this comment

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

I more like meant the forceInParty and forceIsLeader the entire changes here...

}
}

literal("remove").runs { index: Int ->
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use runCatching here

Config.save()
}

literal("addregex").runs { prefix: String, time: Int, message: GreedyString ->
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use runCatching here and add a string to the list and not a regex class

*
* @author Stivais
*/
class ListSetting<E, T : MutableCollection<E>>(
Copy link
Owner

Choose a reason for hiding this comment

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

Do not modify this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i couldn't find any other way to define realRegex
like idk but when you read from config this var realRegex code block doesn't run

    data class CountdownTrigger(val prefix: String, val time: Int, val regex: Boolean, val message: String) {
        @Transient
        var realRegex: Regex? = if (regex) {
            runCatching { Regex(message) }.getOrNull()
        } else {
            null
        }
    }

init {} block runs before config load btw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uh ok

val module: Module,
) : RenderableSetting<HudElement>(name, description), Saving {

constructor(name: String, x: Float, y: Float, scale: Float, toggleable: Boolean, description: String, module: Module, draw: (Boolean) -> Pair<Number, Number>)
Copy link
Owner

Choose a reason for hiding this comment

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

Revert

Copy link
Contributor Author

@FlyModeZ FlyModeZ Aug 8, 2025

Choose a reason for hiding this comment

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

(old) if you have a HUD, toggleable=false, it's also not enabled when first launch
i'm fixing this :<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants