Skip to content
Merged
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
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
10 changes: 5 additions & 5 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ function readChatbox() {
let opts = reader.read() || [];
let chat = '';
// CUSTOM: Ignore currency pouch
const ignoreLine = /\[\d+:\d+:\d+\] \d*,?\d* coins have been added to your money pouch.\s?/g;
const ignoreLine = /\[\d+:\d+:\d+\] [\d,]+ coins have been added to your money pouch.\s?/g;
for (let a in opts) {
chat += opts[a].text.replace(',', '') + ' ';
chat += opts[a].text.replace(/,/g, '') + ' ';
}
chat = chat.replace(ignoreLine, '');
// DEBUG: See chat and opts in console
Expand Down 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 Expand Up @@ -446,7 +446,7 @@ function getTotal(source) {

// Function to display totals on top of the list
function displayTotal(text, total) {
$('#item-list').append(`<li style="color:${rgbColor}">${text}: <strong>${total}</strong></li>`);
$('#item-list').append(`<li style="color:${rgbColor}">${text}: <strong>${total.toLocaleString()}</strong></li>`);
}
// Function to append items to the list below
function appendItems(items) {
Expand Down