ngu
Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta
// @require https://update.sleazyfork.org/scripts/593576/1916878/tamingio.js
// ==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;
});
})();