MidgetJake / UniversalDiscordNotifier

BSD 2-Clause "Simplified" License
4 stars 3 forks source link

Collection log %ITEM% truncates on - #6

Open neckothy opened 2 years ago

neckothy commented 2 years ago

e.g. Leaf-bladed sword

Just got a %ITEM% -> Just got a Leaf

Haven't had the chance to check if this applies to other variable strings like %LOOT%

edit: I guess the regex here is just missing - in the character class https://github.com/MidgetJake/UniversalDiscordNotifier/blob/master/src/main/java/universalDiscord/UniversalDiscordPlugin.java#L70

neckothy commented 2 years ago

- is now fixed, confirmed with Leaf-bladed battleaxe. There is a similar issue with parentheses now. e.g. Mystic robe top (light)

Just got a %ITEM%. -> Just got a Mystic robe top .

edit: Is there any real reason to not just use any character repeating? Assuming you want to avoid that, I wrote a quick script to find characters in current collection log items which should be considered. My results were: /'-(). on top of alphanumerics and spaces (\w\s.) I don't know the specifics of regex in Java but below is a regex which would match all current collection log item names in Python:

"New item added to your collection log: ([/'\w\s\-\(\)\.]*)"