Taming.io Mod Menu Cheat

Mod menu with cheats for Taming.io

目前為 2025-05-22 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Taming.io Mod Menu Cheat
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Mod menu with cheats for Taming.io
// @match        https://taming.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Mod Menu Class
    class ModMenu {
        constructor() {
            this.createMenuUI();
            this.setupEventListeners();
        }

        createMenuUI() {
            // Create mod menu container
            this.menuContainer = document.createElement('div');
            this.menuContainer.style.cssText = `
                position: fixed;
                top: 20px;
                right: 20px;
                background: rgba(0,0,0,0.7);
                color: white;
                padding: 15px;
                border-radius: 10px;
                z-index: 1000;
            `;

            // Cheat toggles
            this.createToggle('One Hit Kill', this.toggleOneHitKill.bind(this));
            this.createToggle('Invincibility', this.toggleInvincibility.bind(this));
            this.createToggle('Speed Hack', this.toggleSpeedHack.bind(this));

            document.body.appendChild(this.menuContainer);
        }

        createToggle(label, callback) {
            const toggleContainer = document.createElement('div');
            const checkbox = document.createElement('input');
            const labelElement = document.createElement('label');

            checkbox.type = 'checkbox';
            checkbox.addEventListener('change', callback);

            labelElement.appendChild(checkbox);
            labelElement.appendChild(document.createTextNode(label));

            toggleContainer.appendChild(labelElement);
            this.menuContainer.appendChild(toggleContainer);
        }

        toggleOneHitKill(event) {
            const isEnabled = event.target.checked;
            try {
                if (isEnabled) {
                    game.player.attack = function() {
                        const target = this.getCurrentTarget();
                        if (target) {
                            target.health = 0;
                        }
                    };
                } else {
                    // Restore original attack method
                    game.player.attack = game.player.originalAttack;
                }
            } catch (error) {
                console.error('One Hit Kill failed:', error);
            }
        }

        toggleInvincibility(event) {
            const isEnabled = event.target.checked;
            try {
                if (isEnabled) {
                    game.player.takeDamage = () => false;
                    game.player.health = game.player.maxHealth;
                } else {
                    // Restore original damage method
                    game.player.takeDamage = game.player.originalTakeDamage;
                }
            } catch (error) {
                console.error('Invincibility failed:', error);
            }
        }

        toggleSpeedHack(event) {
            const isEnabled = event.target.checked;
            try {
                if (isEnabled) {
                    game.player.speed *= 2; // Double speed
                } else {
                    game.player.speed /= 2; // Restore original speed
                }
            } catch (error) {
                console.error('Speed hack failed:', error);
            }
        }

        setupEventListeners() {
            // Add keyboard shortcut to toggle menu
            document.addEventListener('keydown', (e) => {
                if (e.key === 'M' && e.ctrlKey) {
                    this.menuContainer.style.display = 
                        this.menuContainer.style.display === 'none' ? 'block' : 'none';
                }
            });
        }
    }

    // Initialize mod menu when game loads
    function initModMenu() {
        if (typeof game !== 'undefined') {
            window.modMenu = new ModMenu();
        } else {
            setTimeout(initModMenu, 1000);
        }
    }

    // Start initialization
    initModMenu();
})();