Taming.io Mod Menu Cheat

Mod menu with cheats for Taming.io

当前为 2025-05-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Taming.io Mod Menu Cheat
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Mod menu with cheats for Taming.io
  6. // @match https://taming.io/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. // Mod Menu Class
  14. class ModMenu {
  15. constructor() {
  16. this.createMenuUI();
  17. this.setupEventListeners();
  18. }
  19.  
  20. createMenuUI() {
  21. // Create mod menu container
  22. this.menuContainer = document.createElement('div');
  23. this.menuContainer.style.cssText = `
  24. position: fixed;
  25. top: 20px;
  26. right: 20px;
  27. background: rgba(0,0,0,0.7);
  28. color: white;
  29. padding: 15px;
  30. border-radius: 10px;
  31. z-index: 1000;
  32. `;
  33.  
  34. // Cheat toggles
  35. this.createToggle('One Hit Kill', this.toggleOneHitKill.bind(this));
  36. this.createToggle('Invincibility', this.toggleInvincibility.bind(this));
  37. this.createToggle('Speed Hack', this.toggleSpeedHack.bind(this));
  38.  
  39. document.body.appendChild(this.menuContainer);
  40. }
  41.  
  42. createToggle(label, callback) {
  43. const toggleContainer = document.createElement('div');
  44. const checkbox = document.createElement('input');
  45. const labelElement = document.createElement('label');
  46.  
  47. checkbox.type = 'checkbox';
  48. checkbox.addEventListener('change', callback);
  49.  
  50. labelElement.appendChild(checkbox);
  51. labelElement.appendChild(document.createTextNode(label));
  52.  
  53. toggleContainer.appendChild(labelElement);
  54. this.menuContainer.appendChild(toggleContainer);
  55. }
  56.  
  57. toggleOneHitKill(event) {
  58. const isEnabled = event.target.checked;
  59. try {
  60. if (isEnabled) {
  61. game.player.attack = function() {
  62. const target = this.getCurrentTarget();
  63. if (target) {
  64. target.health = 0;
  65. }
  66. };
  67. } else {
  68. // Restore original attack method
  69. game.player.attack = game.player.originalAttack;
  70. }
  71. } catch (error) {
  72. console.error('One Hit Kill failed:', error);
  73. }
  74. }
  75.  
  76. toggleInvincibility(event) {
  77. const isEnabled = event.target.checked;
  78. try {
  79. if (isEnabled) {
  80. game.player.takeDamage = () => false;
  81. game.player.health = game.player.maxHealth;
  82. } else {
  83. // Restore original damage method
  84. game.player.takeDamage = game.player.originalTakeDamage;
  85. }
  86. } catch (error) {
  87. console.error('Invincibility failed:', error);
  88. }
  89. }
  90.  
  91. toggleSpeedHack(event) {
  92. const isEnabled = event.target.checked;
  93. try {
  94. if (isEnabled) {
  95. game.player.speed *= 2; // Double speed
  96. } else {
  97. game.player.speed /= 2; // Restore original speed
  98. }
  99. } catch (error) {
  100. console.error('Speed hack failed:', error);
  101. }
  102. }
  103.  
  104. setupEventListeners() {
  105. // Add keyboard shortcut to toggle menu
  106. document.addEventListener('keydown', (e) => {
  107. if (e.key === 'M' && e.ctrlKey) {
  108. this.menuContainer.style.display =
  109. this.menuContainer.style.display === 'none' ? 'block' : 'none';
  110. }
  111. });
  112. }
  113. }
  114.  
  115. // Initialize mod menu when game loads
  116. function initModMenu() {
  117. if (typeof game !== 'undefined') {
  118. window.modMenu = new ModMenu();
  119. } else {
  120. setTimeout(initModMenu, 1000);
  121. }
  122. }
  123.  
  124. // Start initialization
  125. initModMenu();
  126. })();