Phinally menu

Phinally menu with login functionality and improved UI.

当前为 2025-02-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Phinally menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  5. // @description Phinally menu with login functionality and improved UI.
  6. // @author ZeR
  7. // @match *://cryzen.io/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const newScopeURL = 'https://cdn.discordapp.com/attachments/1124114546810953770/1343722982127833124/cross.webp?ex=67be4f0c&is=67bcfd8c&hm=05ae9ad2c108e6ff5acc1daa1f8e56a4b5173e5ccdebf71f775ed4df8e2c8c30&'; // Mets ici ton viseur
  16.  
  17. let originalMaterialDescriptor = Object.getOwnPropertyDescriptor(Object.prototype, 'material');
  18. let isLoggedIn = false;
  19. let autoBunnyHopInterval = null;
  20. let originalRandom = Math.random;
  21. let scope = null;
  22. let optimizationEnabled = true;
  23. let lowResolutionEnabled = false;
  24. const FPS_THRESHOLD_LOW = 30;
  25. const FPS_THRESHOLD_HIGH = 50;
  26. const OPTIMIZATION_INTERVAL = 3000;
  27.  
  28. let lastCheck = performance.now();
  29. let fps = 0;
  30. let lastTime = performance.now();
  31. let fpsInterval;
  32.  
  33. const fpsDisplay = document.createElement('div');
  34. fpsDisplay.style.position = 'fixed';
  35. fpsDisplay.style.top = '10px';
  36. fpsDisplay.style.right = '10px';
  37. fpsDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  38. fpsDisplay.style.color = 'white';
  39. fpsDisplay.style.padding = '5px';
  40. fpsDisplay.style.zIndex = '1000';
  41. document.body.appendChild(fpsDisplay);
  42.  
  43. function adjustCanvasResolution(scaleFactor) {
  44. const canvas = document.querySelector('canvas');
  45. if (canvas) {
  46. const devicePixelRatio = window.devicePixelRatio * scaleFactor;
  47. canvas.width = window.innerWidth * devicePixelRatio;
  48. canvas.height = window.innerHeight * devicePixelRatio;
  49. console.log(`Canvas resolution adjusted. Scale Factor: ${scaleFactor}`);
  50. }
  51. }
  52.  
  53. function optimizeGame() {
  54. if (!optimizationEnabled) return;
  55. document.querySelectorAll('.high-detail').forEach(element => {
  56. element.style.display = 'none';
  57. });
  58. }
  59.  
  60.  
  61. function countFrames() {
  62. fps++;
  63. const now = performance.now();
  64. if (now - lastTime >= 1000) {
  65. fpsDisplay.innerText = `FPS: ${fps}`;
  66. adjustResolutionBasedOnFPS(fps);
  67. fps = 0;
  68. lastTime = now;
  69. }
  70. requestAnimationFrame(countFrames);
  71. }
  72.  
  73. function adjustResolutionBasedOnFPS(fps) {
  74. if (fps < FPS_THRESHOLD_LOW && !lowResolutionEnabled) {
  75. lowResolutionEnabled = true;
  76. adjustCanvasResolution(0.5);
  77. } else if (fps > FPS_THRESHOLD_HIGH && lowResolutionEnabled) {
  78. lowResolutionEnabled = false;
  79. adjustCanvasResolution(1);
  80. }
  81. }
  82.  
  83.  
  84. countFrames();
  85. const menuCSS = `
  86. #mod-menu {
  87. position: fixed;
  88. top: 50%;
  89. left: 20px;
  90. transform: translateY(-50%);
  91. background: rgba(20, 20, 20, 0.95);
  92. color: white;
  93. padding: 15px;
  94. border-radius: 15px;
  95. border: 2px solid blue;
  96. font-family: Arial, sans-serif;
  97. width: 300px;
  98. height: auto;
  99. display: none;
  100. opacity: 0;
  101. transition: opacity 0.3s ease, transform 0.3s ease;
  102. cursor: grab;
  103. z-index: 9999; /* Assure que le menu est au-dessus des autres éléments */
  104. }
  105.  
  106. #mod-menu.show {
  107. display: block;
  108. opacity: 1;
  109. }
  110.  
  111. #mod-menu:hover {
  112. opacity: 1; /* Garde le menu visible au survol */
  113. }
  114.  
  115. .menu-header {
  116. font-size: 20px;
  117. font-weight: bold;
  118. text-align: center;
  119. margin-bottom: 15px;
  120. cursor: move;
  121. }
  122.  
  123. .menu-category {
  124. font-size: 18px;
  125. font-weight: bold;
  126. text-decoration: underline;
  127. margin-top: 10px;
  128. cursor: pointer;
  129. }
  130.  
  131. .menu-section {
  132. display: none;
  133. flex-direction: column;
  134. gap: 10px;
  135. margin-bottom: 10px;
  136. opacity: 0;
  137. transition: opacity 0.3s ease;
  138. }
  139.  
  140. .menu-button {
  141. background: #333;
  142. border: 1px solid #555;
  143. color: white;
  144. padding: 8px;
  145. border-radius: 8px;
  146. text-align: center;
  147. cursor: pointer;
  148. transition: background 0.2s, transform 0.1s;
  149. }
  150.  
  151. .menu-button:hover {
  152. background: #444;
  153. }
  154.  
  155. .menu-button.active {
  156. background: #4CAF50;
  157. transform: scale(1.05);
  158. }
  159.  
  160. .menu-footer {
  161. font-size: 12px;
  162. color: #888;
  163. text-align: center;
  164. margin-top: 20px;
  165. }
  166.  
  167. #login-screen {
  168. position: fixed;
  169. top: 50%;
  170. left: 50%;
  171. transform: translate(-50%, -50%);
  172. background: rgba(0, 0, 0, 0.8);
  173. padding: 20px;
  174. border-radius: 10px;
  175. width: 300px;
  176. color: white;
  177. text-align: center;
  178. display: none;
  179. opacity: 0;
  180. transition: opacity 0.3s ease;
  181. }
  182.  
  183. #login-screen.show {
  184. display: block;
  185. opacity: 1;
  186. }
  187.  
  188. h2 {
  189. font-size: 24px;
  190. margin-bottom: 20px;
  191. }
  192.  
  193. .login-input {
  194. width: 100%;
  195. padding: 10px;
  196. margin: 10px 0;
  197. border-radius: 5px;
  198. border: 1px solid #555;
  199. color: white;
  200. background: #333;
  201. box-sizing: border-box;
  202. }
  203. .menu-section.active {
  204. display: flex;
  205. opacity: 1;
  206. }
  207.  
  208. .login-button {
  209. background: #4CAF50;
  210. border: none;
  211. color: white;
  212. padding: 12px;
  213. width: 100%;
  214. border-radius: 5px;
  215. cursor: pointer;
  216. margin-top: 10px;
  217. }
  218.  
  219. .login-button:hover {
  220. background: #45a049;
  221. }
  222.  
  223.  
  224. `;
  225.  
  226. function injectCSS(css) {
  227. let style = document.createElement("style");
  228. style.textContent = css;
  229. document.head.appendChild(style);
  230. }
  231.  
  232. function createModMenu() {
  233. let menu = document.createElement("div");
  234. menu.id = "mod-menu";
  235. menu.innerHTML = `
  236. <div class="menu-header">PHINALLY MENU</div>
  237.  
  238. <!-- AIM Section -->
  239. <div class="menu-category" data-section="aim-section">AIM</div>
  240. <div class="menu-section" id="aim-section">
  241. <div class="menu-button" id="no-recoil-button" data-action="toggle-recoil">No Recoil</div>
  242. </div>
  243.  
  244. <!-- MOVEMENT Section -->
  245. <div class="menu-category" data-section="movement-section">MOUVEMENT</div>
  246. <div class="menu-section" id="movement-section">
  247. <div class="menu-button" id="bunnyhop-button" data-action="toggle-bunnyhop">Bunny Hop</div>
  248. </div>
  249.  
  250. <!-- VISUAL Section -->
  251. <div class="menu-category" data-section="visual-section">VISUAL</div>
  252. <div class="menu-section" id="visual-section">
  253. <div class="menu-button" id="esp-button" data-action="toggle-esp">ESP</div>
  254. <div class="menu-button" id="view-button" data-action="toggle-view">Better View</div>
  255. </div>
  256.  
  257. <!-- HACK Section -->
  258. <div class="menu-category" data-section="hack-section">HACK</div>
  259. <div class="menu-section" id="hack-section">
  260. <div class="menu-button" id="adblock-button" data-action="toggle-adblock">Ad Block</div>
  261. <div class="menu-button" id="cross-button" data-action="toggle-cross">Crosshair</div>
  262. </div>
  263.  
  264. <div class="menu-footer">ZeR©</div>
  265. `;
  266. document.body.appendChild(menu);
  267. addMenuEventListeners();
  268. makeMenuDraggable(menu);
  269.  
  270. document.querySelectorAll('.menu-category').forEach(category => {
  271. category.addEventListener('click', (event) => {
  272. const sectionId = event.target.getAttribute('data-section');
  273. const section = document.getElementById(sectionId);
  274.  
  275. if (section.classList.contains('active')) {
  276. section.classList.remove('active');
  277. } else {
  278. document.querySelectorAll('.menu-section').forEach(sec => sec.classList.remove('active'));
  279. section.classList.add('active');
  280. }
  281. });
  282. });
  283. }
  284.  
  285.  
  286. // Crée l'écran de login
  287. function createLoginScreen() {
  288. let loginScreen = document.createElement("div");
  289. loginScreen.id = "login-screen";
  290. loginScreen.innerHTML = `
  291. <h2>Phinally Login</h2>
  292. <input type="text" id="username" class="login-input" placeholder="Username" />
  293. <input type="password" id="password" class="login-input" placeholder="Password" />
  294. <button class="login-button" id="login-button">Login</button>
  295. <div class="menu-footer">ZeR©</div>
  296. `;
  297. document.body.appendChild(loginScreen);
  298. document.getElementById("login-button").addEventListener("click", handleLogin);
  299. }
  300.  
  301.  
  302. const usernameDisplay = document.createElement('div');
  303. usernameDisplay.style.position = 'fixed';
  304. usernameDisplay.style.top = '40px';
  305. usernameDisplay.style.right = '10px';
  306. usernameDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  307. usernameDisplay.style.padding = '5px';
  308. usernameDisplay.style.zIndex = '1000';
  309.  
  310. const loginText = document.createElement('span');
  311. loginText.style.color = 'white';
  312. loginText.textContent = 'Login as ';
  313.  
  314. const usernameText = document.createElement('span');
  315. usernameText.style.color = 'green';
  316. usernameText.textContent = 'username';
  317.  
  318. usernameDisplay.appendChild(loginText);
  319. usernameDisplay.appendChild(usernameText);
  320. document.body.appendChild(usernameDisplay);
  321.  
  322. function updateUsername(username) {
  323. usernameText.textContent = username;
  324. }
  325.  
  326.  
  327. const users = [
  328. { username: 'admin', password: 'admin' },
  329. { username: 'Xeno', password: 'Xeno' }
  330. ];
  331.  
  332. function handleLogin() {
  333. const username = document.getElementById("username").value;
  334. const password = document.getElementById("password").value;
  335. const user = users.find(u => u.username === username && u.password === password);
  336.  
  337. if (user) {
  338. isLoggedIn = true;
  339. document.getElementById("login-screen").classList.remove("show");
  340. updateUsername(username);
  341. setTimeout(() => toggleModMenu(), 300);
  342. } else {
  343. alert("Nom d'utilisateur ou mot de passe incorrect.");
  344. }
  345. }
  346.  
  347. function makeMenuDraggable(menu) {
  348. let isDragging = false, startX, startY;
  349.  
  350. menu.querySelector(".menu-header").addEventListener("mousedown", (event) => {
  351. isDragging = true;
  352. startX = event.clientX - menu.offsetLeft;
  353. startY = event.clientY - menu.offsetTop;
  354. });
  355.  
  356. document.addEventListener("mousemove", (event) => {
  357. if (isDragging) {
  358. menu.style.left = event.clientX - startX + "px";
  359. menu.style.top = event.clientY - startY + "px";
  360. }
  361. });
  362.  
  363. document.addEventListener("mouseup", () => {
  364. isDragging = false;
  365. });
  366. }
  367.  
  368. function toggleModMenu() {
  369. if (isLoggedIn) {
  370. let menu = document.getElementById("mod-menu");
  371. menu.classList.toggle("show");
  372. } else {
  373. document.getElementById("login-screen").classList.add("show");
  374. }
  375. }
  376.  
  377. //////////////////////////////////////////////////
  378. /// ///
  379. /// BUTTON ACTIVATION ///
  380. /// ///
  381. //////////////////////////////////////////////////
  382.  
  383. function addMenuEventListeners() {
  384. const features = [
  385. { id: "no-recoil-button", feature: "no-recoil" },
  386. { id: "bunnyhop-button", feature: "bunnyhop" },
  387. { id: "esp-button", feature: "esp" },
  388. { id: "view-button", feature: "view" },
  389. { id: "adblock-button", feature: "adblock" },
  390. { id: "cross-button", feature: "cross" }
  391. ];
  392.  
  393. features.forEach(({ id, feature }) => {
  394. document.getElementById(id).addEventListener("click", () => toggleFeature(feature, id));
  395. });
  396. }
  397.  
  398. function toggleFeature(feature, buttonId) {
  399. const button = document.getElementById(buttonId);
  400. const isActive = button.classList.contains("active");
  401.  
  402. const action = isActive ? disableFeature : enableFeature;
  403. action(feature);
  404.  
  405. button.classList.toggle("active");
  406. }
  407.  
  408. function enableFeature(feature) {
  409. switch (feature) {
  410. case "no-recoil":
  411. enableNoRecoil();
  412. break;
  413. case "bunnyhop":
  414. enableUP();
  415. break;
  416. case "esp":
  417. enableESP();
  418. break;
  419. case "view":
  420. enableVIEW();
  421. break;
  422. case "cross":
  423. enableCROSS();
  424. break;
  425. case "adblock":
  426. enableAdBlock();
  427. break;
  428. default:
  429. break;
  430. }
  431. }
  432.  
  433. function disableFeature(feature) {
  434. switch (feature) {
  435. case "no-recoil":
  436. disableNoRecoil();
  437. break;
  438. case "bunnyhop":
  439. disableUP();
  440. break;
  441. case "esp":
  442. disableESP();
  443. break;
  444. case "view":
  445. disableVIEW();
  446. break;
  447. case "cross":
  448. disableCROSS();
  449. break;
  450. case "adblock":
  451. disableAdBlock();
  452. break;
  453. default:
  454. break;
  455. }
  456. }
  457.  
  458.  
  459. //////////////////////////////////////////////////
  460. /// ///
  461. /// BUTTON FUNCTION ///
  462. /// ///
  463. //////////////////////////////////////////////////
  464.  
  465. function enableNoRecoil() {
  466. console.log("No Recoil activé !");
  467. const _random = Math.random;
  468. Object.defineProperty(Math, 'random', {
  469. get() {
  470. try {
  471. throw new Error();
  472. } catch (error) {
  473. const stack = error.stack;
  474. if (stack.includes('shoot')) {
  475. return () => 0.5;
  476. }
  477. }
  478. return _random;
  479. }
  480. });
  481. }
  482.  
  483. function disableNoRecoil() {
  484. console.log("No Recoil désactivé !");
  485. Object.defineProperty(Math, 'random', {
  486. get() {
  487. return originalRandom;
  488. }
  489. });
  490. }
  491.  
  492. function enableAdBlock() {
  493. return new Promise(resolve => {
  494. resolve(true);
  495. });
  496. }
  497.  
  498. Object.defineProperties(Object.prototype, {
  499. 'rewardedBreak': {
  500. get() {
  501. return enableAdBlock.bind(this);
  502. },
  503. set() {},
  504. enumerable: false,
  505. }
  506. });
  507. function disableAdBlock() {
  508. console.log("Ad Blocker désactivé !");
  509. }
  510.  
  511. function disableESP() {
  512. console.log("ESP désactivé !");
  513.  
  514. if (originalMaterialDescriptor) {
  515. Object.defineProperty(Object.prototype, 'material', originalMaterialDescriptor);
  516. } else {
  517. delete Object.prototype.material;
  518. }
  519. }
  520.  
  521. function enableESP() {
  522. console.log("ESP activé !");
  523.  
  524. Object.defineProperty(Object.prototype, 'material', {
  525. get() {
  526. return this._material;
  527. },
  528. set(v) {
  529. if (this.type === 'SkinnedMesh' && this?.skeleton) {
  530. Object.defineProperties(v, {
  531. 'depthTest': {
  532. get() {
  533. return false;
  534. },
  535. set(v) {},
  536. },
  537. 'transparent': {
  538. get() {
  539. return true;
  540. },
  541. set(v) {},
  542. },
  543. });
  544. }
  545. this._material = v;
  546. },
  547. });
  548. }
  549.  
  550. function getSqareDataURL(width, height, color) {
  551. const canvas = document.createElement('canvas');
  552. canvas.width = width;
  553. canvas.height = height;
  554. const context = canvas.getContext('2d');
  555. context.fillStyle = color;
  556. context.fillRect(0, 0, width, height);
  557. const dataURL = canvas.toDataURL();
  558. return dataURL;
  559. }
  560.  
  561. const originalSrcDescriptor = Object.getOwnPropertyDescriptor(Image.prototype, 'src');
  562. const srcset = originalSrcDescriptor.set;
  563.  
  564. function enableVIEW() {
  565. console.log("Vue modifiée activée !");
  566.  
  567. Object.defineProperty(Image.prototype, 'src', {
  568. set(value) {
  569. this._src = value;
  570. if (typeof value !== 'string') {
  571. return srcset.call(this, value);
  572. }
  573. if (value.includes('colorMap')) {
  574. if (value.toLowerCase().includes('red')) {
  575. value = getSqareDataURL(1000, 1000, '#FF7373');
  576. } else if (value.toLowerCase().includes('blue')) {
  577. value = getSqareDataURL(1000, 1000, '#00FFFF');
  578. } else {
  579. value = getSqareDataURL(1000, 1000, '#73FF73');
  580. }
  581. }
  582. if (value.includes('map-')) {
  583. value = getSqareDataURL(4096, 2048, '#AAAAAA');
  584. }
  585. srcset.call(this, value);
  586. },
  587. get() {
  588. return this._src;
  589. }
  590. });
  591. }
  592.  
  593. function disableVIEW() {
  594. console.log("Vue modifiée désactivée !");
  595.  
  596. Object.defineProperty(Image.prototype, 'src', originalSrcDescriptor);
  597. }
  598.  
  599. function enableUP() {
  600. console.log("Auto Bunny Hop activé !");
  601.  
  602. document.addEventListener('keydown', (event) => {
  603. if (event.key === ' ' && autoBunnyHopInterval === null) {
  604. autoBunnyHopInterval = setInterval(() => {
  605. const event = new KeyboardEvent('keydown', { key: ' ' });
  606. document.dispatchEvent(event);
  607. }, 3000);
  608. }
  609. });
  610.  
  611. document.addEventListener('keyup', (event) => {
  612. if (event.key === ' ') {
  613. clearInterval(autoBunnyHopInterval);
  614. autoBunnyHopInterval = null;
  615. }
  616. });
  617. }
  618. function disableUP() {
  619. console.log("Auto Bunny Hop activé !");
  620. }
  621.  
  622. function createScopeOverlay() {
  623. scope = document.createElement("img");
  624. scope.src = newScopeURL;
  625. scope.id = "custom-sniper-scope";
  626. scope.style.position = "fixed";
  627. scope.style.top = "50%";
  628. scope.style.left = "50%";
  629. scope.style.transform = "translate(-50%, -50%)";
  630. scope.style.pointerEvents = "none";
  631. scope.style.maxWidth = "100vw";
  632. scope.style.maxHeight = "100vh";
  633. scope.style.zIndex = "99999";
  634. document.body.appendChild(scope);
  635. }
  636.  
  637. function enableCROSS() {
  638. if (!scope) {
  639. createScopeOverlay();
  640. } else {
  641. scope.style.display = "block";
  642. }
  643. }
  644.  
  645. function disableCROSS() {
  646. if (scope) {
  647. scope.style.display = "none";
  648. }
  649. }
  650.  
  651.  
  652.  
  653. function updateFPS() {
  654. const now = performance.now();
  655. const delta = now - lastTime;
  656.  
  657. if (delta > 100) {
  658. const fps = Math.round(1000 / delta);
  659. fpsDisplay.textContent = `FPS: ${fps}`;
  660. lastTime = now;
  661. }
  662. }
  663.  
  664. function enableFPS() {
  665. fpsInterval = setInterval(updateFPS, 100);
  666. fpsDisplay.style.display = 'block';
  667. }
  668.  
  669. function disableFPS() {
  670. clearInterval(fpsInterval);
  671. fpsDisplay.style.display = 'none';
  672. }
  673.  
  674.  
  675. //////////////////////////////////////////////////
  676. /// ///
  677. /// END BUTTON FUNCTION ///
  678. /// ///
  679. //////////////////////////////////////////////////
  680.  
  681.  
  682. injectCSS(menuCSS);
  683.  
  684. createLoginScreen();
  685.  
  686. createModMenu();
  687.  
  688. document.addEventListener("keydown", function(event) {
  689. if (event.key === "Insert") {
  690. if (isLoggedIn) {
  691. toggleModMenu();
  692. } else {
  693. document.getElementById("login-screen").classList.add("show");
  694. }
  695. }
  696. });
  697. })();