Alt-Click to attack page

Alt+click user links to attack

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Alt-Click to attack page
// @namespace    http://tampermonkey.net/
// @author       Weav3r
// @version      1.0
// @description  Alt+click user links to attack
// @match        https://www.torn.com/*
// ==/UserScript==

document.addEventListener('click', e => {
    if (!e.altKey) return;
    const link = e.target.closest('a[href*="/profiles.php?XID="]');
    if (link) {
        e.preventDefault();
        location.href = `https://www.torn.com/loader.php?sid=attack&user2ID=${link.href.match(/XID=(\d+)/)[1]}`;
    }
});