Building this into the hotkey Current.
Replace R, or Use W.
Code:
document.addEventListener("keydown", (event) => {
if (HK) {
if (event.keyCode === 87) {
event.preventDefault();
for (let line of top.OldChat) {
if (line.indexOf("<u>PM from</u>") > -1) {
let target = line.substring(parseInt(line.indexOf(")>") + 2, 10), parseInt(line.indexOf("</a"), 10));
document.getElementById("chattybox").value = `/m ${target}:`;
document.getElementById("chattybox").focus();
break;
}
}
}
}
});
Scans chat for last pm. Automatically fills in /m target: and focues chat.