Attack Bind

Press ALT+A on player profile to go to attack page

目前为 2024-10-26 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Attack Bind
  3. // @namespace Titanic_
  4. // @version 1.0
  5. // @description Press ALT+A on player profile to go to attack page
  6. // @license MIT
  7. // @author Titanic_ [2968477]
  8. // @match https://www.torn.com/profiles.php*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. document.addEventListener("keydown", function(event) {
  13. if (event.altKey && event.key === "a") { // ALT + A to take to attack page
  14. const targetID = window.location.href.split("XID=")[1] ? window.location.href.split("XID=")[1].split("&")[0] : null;
  15. if(targetID) {
  16. window.location.href = `https://www.torn.com/loader.php?sid=attack&user2ID=${targetID}`
  17. }
  18. }
  19. });