Attacking Fakie

Inverts the attacking layout horizontally, placing buttons on the right side of the screen

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Attacking Fakie
// @namespace    dev.kwack.torn.attacking-fakie
// @version      1.0.0
// @description  Inverts the attacking layout horizontally, placing buttons on the right side of the screen
// @author       Kwack [2190604]
// @match        https://www.torn.com/loader.php
// @run-at 		 document-end
// ==/UserScript==
if (new URL(document.location).searchParams.get("sid") !== "attack") return; // Only trigger on the attack page
(() => {
	"use strict";
	waitForElement("#attacker > div[class*=playerArea_]").then((element) => {
		element.css("flex-direction", "row-reverse");
	});

	function waitForElement(selector) {
		return new Promise((res) => {
			const getElement = () => {
				const element = $(selector);
				if (element.length) {
					res(element);
				} else {
					setTimeout(getElement, 100);
				}
			}
			getElement();
		})
	}
})();