Pwzz Mod Menu - Wormax2.io Zoom Hack

Wormax2.io için havalı bir mod menüsü ile zoom hack! Pwzz ile zoom seviyesini slider ile ayarla.

  1. // ==UserScript==
  2. // @name Pwzz Mod Menu - Wormax2.io Zoom Hack
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Wormax2.io için havalı bir mod menüsü ile zoom hack! Pwzz ile zoom seviyesini slider ile ayarla.
  6. // @author mf
  7. // @license pwzz and mf ai
  8. // @match https://wormax2.io/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. console.log('[Pwzz] Mod Menüsü ve Zoom Hack Başlatılıyor...');
  16.  
  17. // Debug log fonksiyonu
  18. function log(message) {
  19. console.log(`[Pwzz] ${message}`);
  20. }
  21.  
  22. // Global değişkenler
  23. window.pwzz = window.pwzz || {}; // Global bir namespace oluştur
  24. window.pwzz.targetCamera = window.pwzz.targetCamera || null; // Kamerayı saklamak için
  25. window.pwzz.cameraControllerInstance = window.pwzz.cameraControllerInstance || null; // CameraController instance’ını saklamak için
  26. window.pwzz.isCameraFound = window.pwzz.isCameraFound || false; // Kameranın bulunup bulunmadığını takip et
  27. window.pwzz.desiredZoom = 2; // Slider’dan alınacak istenen zoom değeri (varsayılan 2x)
  28.  
  29. // Derin nesne tarama fonksiyonu (recursive)
  30. function deepSearch(obj, targetKey, depth = 0, maxDepth = 5) {
  31. if (depth > maxDepth) return null;
  32. if (!obj || typeof obj !== 'object') return null;
  33.  
  34. for (let key in obj) {
  35. if (key === targetKey) {
  36. log(`Hedef bulundu: ${key} (derinlik: ${depth})`);
  37. return obj[key];
  38. }
  39. if (typeof obj[key] === 'object') {
  40. const result = deepSearch(obj[key], targetKey, depth + 1, maxDepth);
  41. if (result) {
  42. log(`Derin tarama sonucu bulundu: ${key}.${targetKey}`);
  43. return result;
  44. }
  45. }
  46. }
  47. return null;
  48. }
  49.  
  50. // Kamerayı bir kez bul ve global olarak sakla
  51. function findCameraOnce() {
  52. if (window.pwzz.isCameraFound) {
  53. log('Kamera nesnesi zaten global olarak saklandı, tekrar aranmıyor.');
  54. return true;
  55. }
  56.  
  57. log('Kamera nesnesi aranıyor...');
  58.  
  59. const namespaces = [window, window.SnakeGame, window.cggl, window.nescc, window.nescg2];
  60. for (let ns of namespaces) {
  61. if (!ns) continue;
  62.  
  63. // PlayerCameraController’ı ara
  64. let cameraController = deepSearch(ns, 'PlayerCameraController');
  65. if (cameraController) {
  66. try {
  67. // Prototip üzerinden kamera bul
  68. if (cameraController.prototype && cameraController.prototype.camera) {
  69. window.pwzz.targetCamera = cameraController.prototype.camera;
  70. window.pwzz.targetCamera.zoom = window.pwzz.desiredZoom; // Varsayılan zoom
  71. log('PlayerCameraController zoom bulundu (prototip).');
  72. overrideAct1(cameraController);
  73. window.pwzz.isCameraFound = true;
  74. return true;
  75. }
  76. // Instance tarama
  77. for (let key in cameraController) {
  78. if (cameraController[key] && cameraController[key].camera && typeof cameraController[key].camera.zoom === 'number') {
  79. window.pwzz.targetCamera = cameraController[key].camera;
  80. window.pwzz.cameraControllerInstance = cameraController[key];
  81. window.pwzz.targetCamera.zoom = window.pwzz.desiredZoom; // Varsayılan zoom
  82. log('PlayerCameraController instance zoom bulundu.');
  83. overrideAct1(cameraController);
  84. window.pwzz.isCameraFound = true;
  85. return true;
  86. }
  87. }
  88. } catch (e) {
  89. log('PlayerCameraController zoom hatası: ' + e);
  90. }
  91. }
  92.  
  93. // Genel kamera nesnesi ara
  94. let camera = deepSearch(ns, 'camera');
  95. if (camera && typeof camera.zoom === 'number') {
  96. window.pwzz.targetCamera = camera;
  97. window.pwzz.targetCamera.zoom = window.pwzz.desiredZoom; // Varsayılan zoom
  98. log('Genel kamera nesnesi bulundu.');
  99. window.pwzz.isCameraFound = true;
  100. return true;
  101. }
  102. }
  103.  
  104. log('Kamera nesnesi bulunamadı.');
  105. return false;
  106. }
  107.  
  108. // act_1 fonksiyonunu override et (sunucu kontrolünü devre dışı bırak)
  109. function overrideAct1(cameraController) {
  110. try {
  111. // Prototip üzerinden override
  112. if (cameraController.prototype && cameraController.prototype.act_1) {
  113. cameraController.prototype.act_1 = function() {
  114. if (this.camera) {
  115. this.camera.zoom = window.pwzz.desiredZoom; // Dinamik zoom
  116. const snakeView = this.gameView.getPlayerSnakeView();
  117. if (snakeView && this.follow) {
  118. this.camera.position_0.set_30(snakeView.getX_0(), snakeView.getY_0(), 0);
  119. }
  120. log('act_1 override (prototip): Zoom dinamik olarak ayarlandı.');
  121. }
  122. };
  123. log('act_1 fonksiyonu (prototip) override edildi.');
  124. }
  125.  
  126. // Instance üzerinden override
  127. if (window.pwzz.cameraControllerInstance && window.pwzz.cameraControllerInstance.act_1) {
  128. window.pwzz.cameraControllerInstance.act_1 = function() {
  129. if (this.camera) {
  130. this.camera.zoom = window.pwzz.desiredZoom; // Dinamik zoom
  131. const snakeView = this.gameView.getPlayerSnakeView();
  132. if (snakeView && this.follow) {
  133. this.camera.position_0.set_30(snakeView.getX_0(), snakeView.getY_0(), 0);
  134. }
  135. log('act_1 override (instance): Zoom dinamik olarak ayarlandı.');
  136. }
  137. };
  138. log('act_1 fonksiyonu (instance) override edildi.');
  139. }
  140. } catch (e) {
  141. log('act_1 override hatası: ' + e);
  142. }
  143. }
  144.  
  145. // Zoom seviyesini her 5 ms’de bir sabitle (sunucu sıfırlamasına karşı)
  146. function keepZoomFixed() {
  147. if (window.pwzz.targetCamera) {
  148. const interval = setInterval(() => {
  149. if (window.pwzz.targetCamera.zoom !== window.pwzz.desiredZoom) {
  150. window.pwzz.targetCamera.zoom = window.pwzz.desiredZoom;
  151. log(`Zoom sıfırlanmaya çalışıldı, tekrar ${window.pwzz.desiredZoom}xe sabitlendi.`);
  152. }
  153. }, 5); // 5 ms’de bir kontrol
  154. log('Sürekli zoom güncelleme aktif (5 ms).');
  155. }
  156. }
  157.  
  158. // Havalı mod menüsü oluştur
  159. function createModMenu() {
  160. // Mevcut bir menü varsa kaldır
  161. const existingMenu = document.querySelector('.pwzz-menu');
  162. if (existingMenu) {
  163. existingMenu.remove();
  164. log('Eski mod menüsü kaldırıldı.');
  165. }
  166.  
  167. // CSS stilleri
  168. const styles = `
  169. .pwzz-menu {
  170. position: fixed;
  171. top: 20px;
  172. right: 20px;
  173. background: linear-gradient(135deg, #1e1e2f 0%, #2a2a4e 100%);
  174. border: 2px solid #00ffcc;
  175. border-radius: 15px;
  176. padding: 15px;
  177. box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
  178. z-index: 9999;
  179. font-family: 'Orbitron', sans-serif;
  180. color: #00ffcc;
  181. transition: all 0.3s ease;
  182. }
  183. .pwzz-menu h2 {
  184. margin: 0 0 10px 0;
  185. font-size: 24px;
  186. text-shadow: 0 0 10px #00ffcc;
  187. text-align: center;
  188. }
  189. .pwzz-menu label {
  190. display: block;
  191. margin-bottom: 5px;
  192. font-size: 14px;
  193. text-shadow: 0 0 5px #00ffcc;
  194. }
  195. .pwzz-menu input[type="range"] {
  196. width: 100%;
  197. -webkit-appearance: none;
  198. height: 8px;
  199. background: linear-gradient(90deg, #00ffcc 0%, #ff00cc 100%);
  200. border-radius: 5px;
  201. outline: none;
  202. box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
  203. }
  204. .pwzz-menu input[type="range"]::-webkit-slider-thumb {
  205. -webkit-appearance: none;
  206. width: 20px;
  207. height: 20px;
  208. background: #1e1e2f;
  209. border: 2px solid #00ffcc;
  210. border-radius: 50%;
  211. cursor: pointer;
  212. box-shadow: 0 0 10px #00ffcc;
  213. }
  214. .pwzz-menu .zoom-value {
  215. text-align: center;
  216. margin-top: 5px;
  217. font-size: 12px;
  218. text-shadow: 0 0 5px #00ffcc;
  219. }
  220. `;
  221.  
  222. // Stil elementini ekle
  223. const existingStyles = document.querySelector('style[pwzz-styles]');
  224. if (existingStyles) {
  225. existingStyles.remove();
  226. }
  227. const styleSheet = document.createElement('style');
  228. styleSheet.setAttribute('pwzz-styles', 'true');
  229. styleSheet.type = 'text/css';
  230. styleSheet.innerText = styles;
  231. document.head.appendChild(styleSheet);
  232. log('Mod menüsü stilleri eklendi.');
  233.  
  234. // Google Fonts’tan Orbitron fontunu ekle
  235. const existingFont = document.querySelector('link[pwzz-font]');
  236. if (!existingFont) {
  237. const fontLink = document.createElement('link');
  238. fontLink.setAttribute('pwzz-font', 'true');
  239. fontLink.href = 'https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap';
  240. fontLink.rel = 'stylesheet';
  241. document.head.appendChild(fontLink);
  242. log('Orbitron fontu eklendi.');
  243. }
  244.  
  245. // Mod menüsü HTML’i
  246. const menu = document.createElement('div');
  247. menu.className = 'pwzz-menu';
  248. menu.innerHTML = `
  249. <h2>Pwzz Mod Menu</h2>
  250. <label>Zoom Seviyesi (1x - 5x)</label>
  251. <input type="range" id="zoomSlider" min="1" max="5" step="0.1" value="2">
  252. <div class="zoom-value">Zoom: 2x</div>
  253. `;
  254. document.body.appendChild(menu);
  255. log('Mod menüsü HTML’i eklendi.');
  256.  
  257. // Slider olay dinleyicisi
  258. const zoomSlider = document.getElementById('zoomSlider');
  259. const zoomValueDisplay = menu.querySelector('.zoom-value');
  260. if (zoomSlider && zoomValueDisplay) {
  261. zoomSlider.addEventListener('input', (e) => {
  262. const zoomValue = parseFloat(e.target.value);
  263. window.pwzz.desiredZoom = zoomValue; // İstenen zoom değerini güncelle
  264. if (window.pwzz.targetCamera) {
  265. window.pwzz.targetCamera.zoom = zoomValue;
  266. log(`Zoom seviyesi slider ile değiştirildi: ${zoomValue}x`);
  267. }
  268. zoomValueDisplay.textContent = `Zoom: ${zoomValue}x`;
  269. });
  270. log('Zoom slider’ı aktif.');
  271. } else {
  272. log('Zoom slider veya zoom değeri elementi bulunamadı.');
  273. }
  274. }
  275.  
  276. // Ana yürütme
  277. let attempts = 0;
  278. const maxAttempts = 30;
  279. const interval = setInterval(() => {
  280. attempts++;
  281. log(`Deneme ${attempts}/${maxAttempts}`);
  282.  
  283. if (findCameraOnce()) {
  284. log('Zoom başarılı! Pwzz Mod Menüsü yükleniyor...');
  285. createModMenu();
  286. keepZoomFixed(); // Sürekli zoom güncellemesini başlat
  287. clearInterval(interval);
  288. return;
  289. }
  290.  
  291. if (attempts >= maxAttempts) {
  292. log('Denemeler bitti, kamera nesnesi bulunamadı.');
  293. clearInterval(interval);
  294. }
  295. }, 500);
  296. })();