diff options
| author | Christopher Gwynn <[email protected]> | 2021-02-20 07:09:25 -0500 |
|---|---|---|
| committer | Christopher Gwynn <[email protected]> | 2021-02-20 07:09:25 -0500 |
| commit | f222eeeae493dc04cb0bc56bb991e763037192a1 (patch) | |
| tree | f125e085ee6118ae9bed28a102864c31a4bbe1ab | |
| parent | commands to change settings (diff) | |
| download | wizard101-rpc-f222eeeae493dc04cb0bc56bb991e763037192a1.tar.xz wizard101-rpc-f222eeeae493dc04cb0bc56bb991e763037192a1.zip | |
better health updates
| -rw-r--r-- | index.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |