Skip to content

Commit

Permalink
fix: update regex for D&D tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ExInferi committed Dec 8, 2024
1 parent 1d2e49f commit c855948
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ Have fun tracking!

## Updates

**Update 8 December 2024, 20:45 Game Time**:

* Fixed D&D Tokens not fully capturing within mystery gifts.

**Update 3 December 2024, 07:30 Game Time**:

* Added tracking of mystery gift contents
* Added tracking of mystery gift contents.

**Update 2 December 2024, 20:45 Game Time**:

Expand Down
4 changes: 2 additions & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ function readChatbox() {
});
}
if (foundMystery) {
const regex = /(\[\d+:\d+:\d+\]) You unwrap your mystery gift and receive: \s?((?:\1 \d+[ x ][\w\s':+\-!()\d]+ ?)+)/g;
const itemRegex = /\[\d+:\d+:\d+\] (\d+)\s*x?\s*([\w\s'+:\-!()\d]*)/g;
const regex = /(\[\d+:\d+:\d+\]) You unwrap your mystery gift and receive: \s?((?:\1 \d+[ x ][\w\s':&+\-!()\d]+ ?)+)/g;
const itemRegex = /\[\d+:\d+:\d+\] (\d+)\s*x?\s*([\w\s'+&:\-!()\d]*)/g;
const rewardRegex = new RegExp(regex.source);
const rewards = chat.match(regex);
const counter = `${APP_PREFIX}MysteryGifts`;
Expand Down

0 comments on commit c855948

Please sign in to comment.