Don't Hunt

Disables the hunting screen to prevent you from using your energy while in SA.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Don't Hunt
// @namespace    https://greatest.deepsurf.us/en/scripts/402084-don-t-hunt
// @version      1.0
// @description  Disables the hunting screen to prevent you from using your energy while in SA.
// @author       cryosis7 [926640]
// @match        https://www.torn.com/index.php?page=hunting
// ==/UserScript==

'use strict'

let blocker = elementCreator('div', { 'class': 'm-top10' });
blocker.appendChild(elementCreator('div', { 'class': 'title-black top-round', 'aria-level': '5' }, 'STOP'));
let body = (elementCreator('div', { 'class': 'bottom-round cont-gray p10' }))
body.appendChild(elementCreator('p', null, "You are <span style='color: red; font-weight:bold'>NOT</span> allowed to use your energy to hunt!"));
body.appendChild(document.createElement('br'));
blocker.appendChild(body)

document.querySelector('.hunt').replaceWith(blocker);

/**
 * Creates an HTML element according to the given parameters
 * 
 * @param {String} type The HTML type to create ('div')
 * @param {Object} attributes Attributes to set {'class': 'wrapper'}
 * @param {String} text 'Inner text/html to set'
 */
function elementCreator(type = 'div', attributes, text) {
    let el = document.createElement(type);
    for (let attribute in attributes)
        el.setAttribute(attribute, attributes[attribute])
    if (text) el.innerHTML = text;
    return el
}