Sorry about that.
Here is the fixed version, which considers how much you sent/received in each tx:
// ==UserScript==
// @name Total Merit Sent & Received on Merit page
// @version 0.2
// @author TryNinja
// @match https://bitcointalk.org/index.php?*action=merit;*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const sent = document.querySelectorAll("#bodyarea > ul:nth-child(5) > li");
const received = document.querySelectorAll("#bodyarea > ul:nth-child(7) > li");
var totalReceived = 0;
var totalSent = 0;
received.forEach(receivedTx => {
const txValue = receivedTx.innerHTML.replace(/^(.*?\: )( for.*)|( from.*)/, "").replace(/(.*: )/, "");
totalReceived += parseInt(txValue);
})
sent.forEach(sentTx => {
const txValue = sentTx.innerHTML.replace(/^(.*?\: )( for.*)|( to.*)/, "").replace(/(.*: )/, "");
totalSent += parseInt(txValue);
})
const sentH3 = document.querySelector("#bodyarea > h3:nth-child(4)");
const receivedH3 = document.querySelector("#bodyarea > h3:nth-child(6)");
var sentNode = document.createTextNode(" (total: " + totalSent + ")");
var receivedNode = document.createTextNode(" (total: " + totalReceived + ")");
sentH3.appendChild(sentNode);
receivedH3.appendChild(receivedNode);
})();
My received in the last 120 days went from 156 to 264.