aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Gwynn <[email protected]>2021-02-20 07:09:25 -0500
committerChristopher Gwynn <[email protected]>2021-02-20 07:09:25 -0500
commitf222eeeae493dc04cb0bc56bb991e763037192a1 (patch)
treef125e085ee6118ae9bed28a102864c31a4bbe1ab
parentcommands to change settings (diff)
downloadwizard101-rpc-f222eeeae493dc04cb0bc56bb991e763037192a1.tar.xz
wizard101-rpc-f222eeeae493dc04cb0bc56bb991e763037192a1.zip
better health updates
-rw-r--r--index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.js b/index.js
index 9b85ae3..51d08d4 100644
--- a/index.js
+++ b/index.js
@@ -35,12 +35,12 @@ function setPresence() {
}
// Get health
- const healthRegex = new RegExp(/WizClientGameEf (.+): Updating health globe \(new health: (\d+), new health max: (\d+)\)/gm);
+ const healthRegex = new RegExp(/Updating health globe \(new health: (\d+), new health max: (\d+)\)\r\n(?!(.+)called for a player that is not this client's!)/gm); // /Updating health globe \(new health: (\d+), new health max: (\d+)\)\n(?!(.+)called for a player that is not this client's!)/gm
let tempHealth = logChunk.match(healthRegex);
if(tempHealth) {
health = healthRegex.exec(tempHealth[tempHealth.length - 1]);
- health = health[3] < health[2] ? [health[2], health[2]] : [health[2], health[3]];
+ health = health[2] < health[1] ? [health[1], health[1]] : [health[1], health[2]];
}
// Check if the game has been quit