Alt-Click to attack page

Alt+click user links to attack

  1. // ==UserScript==
  2. // @name Alt-Click to attack page
  3. // @namespace http://tampermonkey.net/
  4. // @author Weav3r
  5. // @version 1.0
  6. // @description Alt+click user links to attack
  7. // @match https://www.torn.com/*
  8. // ==/UserScript==
  9.  
  10. document.addEventListener('click', e => {
  11. if (!e.altKey) return;
  12. const link = e.target.closest('a[href*="/profiles.php?XID="]');
  13. if (link) {
  14. e.preventDefault();
  15. location.href = `https://www.torn.com/loader.php?sid=attack&user2ID=${link.href.match(/XID=(\d+)/)[1]}`;
  16. }
  17. });