taming.io

ngu

สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.sleazyfork.org/scripts/593576/1916878/tamingio.js

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

You will need to install an extension such as Tampermonkey or Violentmonkey 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         Taming.io Auto Farm
// @match        https://taming.io/*
// @grant        none
// ==UserScript==

(function() {
    'use strict';

    let autoFarm = true;
    let autoHeal = true;

    function pressKey(key) {
        document.dispatchEvent(new KeyboardEvent('keydown', { key: key }));
        setTimeout(() => {
            document.dispatchEvent(new KeyboardEvent('keyup', { key: key }));
        }, 100);
    }

    // Auto-farm resources every 500ms
    setInterval(() => {
        if (autoFarm) pressKey("e"); // Default hit/gather key
    }, 500);

    // Auto-heal when HP drops
    setInterval(() => {
        let hpElement = document.querySelector("#health-bar");
        if (hpElement && autoHeal) {
            let hp = parseInt(hpElement.style.width.replace("%", ""));
            if (hp < 30) pressKey("q"); // Consumes gapples/food
        }
    }, 1000);

    // Toggle controls
    document.addEventListener("keydown", (e) => {
        if (e.key === "f") autoFarm = !autoFarm;
        if (e.key === "h") autoHeal = !autoHeal;
    });
})();