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: Open in EliteWebsite #915

Closed

Conversation

RayDeeUx
Copy link
Contributor

@RayDeeUx RayDeeUx commented Jan 12, 2024

What

Changelog New Features

Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
… function itself or before calling the function"

Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>
Copy link
Collaborator

@CalMWolfs CalMWolfs left a comment

Choose a reason for hiding this comment

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

Looking pretty good (haven't tested)

@hannibal002 hannibal002 added this to the Version 0.24 milestone Jan 15, 2024
@hannibal002 hannibal002 added the Soon This Pull Request will be merged within the next couple of betas label Feb 22, 2024
private val elitebotDevRepoGroup = RepoPattern.group("garden.contest.elitebot")
private val calendarDatePattern by elitebotDevRepoGroup.pattern(
"date.chestanditem",
"(?<sbTime>(?<month>(?:Early |Late )?(?:Winter|Spring|Summer|Autumn|Fall))(?: (?<date>\\d+)(?:nd|rd|th|st))?, Year (?<year>[\\d,.]+))"
Copy link
Owner

Choose a reason for hiding this comment

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

this feels duplicate to another feature of yours. maybe write a common api or use existing data instead.

val useItemName = chestName == "Your Contests" && contestsPattern.matches(firstLoreLine)
val useChestName = jacobsFarmingContestPattern.matches(firstLoreLine)
val theString = if (useItemName) itemName else if (useChestName) chestName else return
calendarDatePattern.matchMatcher(theString) {
Copy link
Owner

Choose a reason for hiding this comment

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

reading time from calendar already exists in jacob contest detection. write common utils functions/ use a calendar fetch api instead of code duplication

}
}

private fun SkyBlockTime.isValidContest(): Boolean = this.asTimeMark() in EARLIEST_CONTEST..SkyBlockTime.now().asTimeMark()
Copy link
Owner

Choose a reason for hiding this comment

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

maybe move into garden api?

)
private val jacobsFarmingContestPattern by elitebotDevRepoGroup.pattern(
"contest.loreline",
"(?:§.)*(?:[\\S ]+)?\\d+:\\d+ [ap]m(?:-|[\\S ]+)\\d+:\\d+ [ap]m: (?:§.)*Jacob's Farming Contest(?:§.)*(?: \\((?:§.)*(?:\\d+[ywhm] )*\\d+s(?:§.)*\\)| \\((?:§.)*[\\S ]+(?:§.)*\\))?"
Copy link
Owner

Choose a reason for hiding this comment

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

dont use regex this way.

@hannibal002 hannibal002 removed the Soon This Pull Request will be merged within the next couple of betas label Mar 12, 2024
@ptlthg
Copy link
Contributor

ptlthg commented Mar 16, 2024

Kinda late, but the website also has https://elitebot.dev/contest/<timestamp> which takes unix seconds and redirects you to the nearest contest. Ex: https://elitebot.dev/contest/1708528500

Also relevant for #1185

@CalMWolfs CalMWolfs closed this Apr 4, 2024
@CalMWolfs CalMWolfs removed this from the Version 0.25 milestone Apr 4, 2024
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.

4 participants