blackhack

Cheat for brofist.io

// ==UserScript==
// @name           blackhack
// @version        1.13.15
// @description    Cheat for brofist.io
// @author         CiNoP
// @match          https://brofist.io/
// @match          https://brofist.io/modes/twoPlayer/c/index.html
// @match          https://brofist.io/modes/hideAndSeek/c/index.html
// @match          https://brofist.io/modes/sandbox/c/index.html
// @icon           https://www.google.com/s2/favicons?sz=64&domain=brofist.io
// @grant          none
// @license        GPL-3.0-only
// @namespace      brofist.io 1st-cheat (FOR ALL MODES)
// ==/UserScript==
/* jshint esversion: 11 */
/* jshint asi: true */

document.body.insertAdjacentHTML("beforebegin",
  `<button id="infoPanelBtn" style="display: inherit; width: 30px; height: 30px; position: fixed; top: 50%; left: 0px; background: rgba(0, 0, 0, 0.3); color: rgb(255, 255, 255); border: none; cursor: pointer;">ⓘ</button>`
);

document.body.insertAdjacentHTML("beforebegin",
  `<div id="infoPanelArrow" style="position: fixed; left: 35px; top: 50%; font-size: 30px; color: #FF4136; opacity: 0; transform: translateY(-50%);">➤</div>`
);

document.getElementById('infoPanelBtn').addEventListener('click', () => {
  const panel = document.getElementById('cheatInfoPanel');
  panel.style.display = (panel.style.display === 'none') ? 'block' : 'none';
});

document.body.insertAdjacentHTML("beforebegin",
  `<div id="cheatInfoPanel" style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.8); color: rgb(255, 255, 255); padding: 15px; border-radius: 5px; font-size: 20px; text-align: center; z-index: 1000; font-family: Arial, sans-serif; cursor: move; max-width: 90%; max-height: 90%; overflow: auto; user-select: none;">
    <div style="margin-bottom: 10px;">
      <button id="decreaseFont" style="margin-right: 5px;">-</button>
      <button id="increaseFont">+</button>
    </div>
    <div id="cheatInfoText">
      ${getCheatInfoText()}
    </div>
  </div>`
);

makePanelDraggable(document.getElementById('cheatInfoPanel'));

function getCheatInfoText() {
  if (window.location.href === 'https://brofist.io/') {
    return "Зайдите в любой режим";
  } else if (window.location.href === 'https://brofist.io/modes/twoPlayer/c/index.html') {
    return `
<b>Функционал чита:</b><br>
английская <b>C</b> - Рывок (во все стороны)<br>
англ. <b>Z</b> - Прыжок с возможностью второго прыжка<br>
<b>F2</b> - Режим бога<br>
<b>ё</b> или <b>\`</b> - Изменение скорости в режиме бога<br>
<b>F4</b> - Невосприимчивость к яду<br>
<b>F9</b> - Невосприимчивость к смерти (по умолчанию вкл.)<br>
<b>Home</b>/<b>End</b> - тп к спавну/двери<br>
Зажатие англ. <b>S</b> - Увеличение массы в 3 раза<br>
<b>Insert</b> - Тп к игроку<br>
<b>Колесо мыши</b> - Выдача вертикальной скорости<br>
<b>Правый клик</b> - Телепорт к месту на котором ваш курсор<br><br>

<b>А так же:</b><br>
Информация об игроке, скриптовых переменных и т.п. в левой верхней панели<br>
Переключение между новым и старым передвижением в левой нижней панели<br>
Нажмите <b>Esc</b> чтобы скрыть новые панели<br>
    `;
  } else {
    return `
<b>Функционал чита:</b><br>
английская <b>C</b> - Рывок (во все стороны)<br>
англ. <b>Z</b> - Прыжок с возможностью второго прыжка<br>
<b>F2</b> - Режим бога<br>
<b>ё</b> или <b>\`</b> - Изменение скорости в режиме бога<br>
Зажатие англ. <b>S</b> - Увеличение массы в 3 раза<br>
<b>Колесо мыши</b> - Выдача вертикальной скорости<br><br>

<b>А так же:</b><br>
Информация об игроке, скриптовых переменных и т.п. в левой верхней панели<br>
Переключение между новым и старым передвижением в левой нижней панели<br>
Нажмите <b>Esc</b> чтобы скрыть новые панели<br>
    `;
  }
}

function makePanelDraggable(panel) {
  let isDragging = false;
  let startX, startY, initialX, initialY;

  panel.addEventListener('mousedown', dragStart);
  document.addEventListener('mouseup', dragEnd);
  document.addEventListener('mousemove', drag);

  function dragStart(e) {
    isDragging = true;
    startX = e.clientX;
    startY = e.clientY;
    const rect = panel.getBoundingClientRect();
    initialX = rect.left;
    initialY = rect.top;
    panel.style.transform = 'none';
  }

  function drag(e) {
    if (!isDragging) return;

    const offsetX = e.clientX - startX;
    const offsetY = e.clientY - startY;

    let newX = initialX + offsetX;
    let newY = initialY + offsetY;

    const windowWidth = window.innerWidth;
    const windowHeight = window.innerHeight;
    const panelRect = panel.getBoundingClientRect();

    const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
    const scrollbarHeight = window.innerHeight - document.documentElement.clientHeight;

    newX = Math.max(0, Math.min(windowWidth - panelRect.width - scrollbarWidth, newX));
    newY = Math.max(0, Math.min(windowHeight - panelRect.height - scrollbarHeight, newY));

    panel.style.left = `${newX}px`;
    panel.style.top = `${newY}px`;
  }

  function dragEnd() {
    isDragging = false;
  }
}

const cheatInfoPanel = document.getElementById('cheatInfoPanel');
const cheatInfoText = document.getElementById('cheatInfoText');
const decreaseFontBtn = document.getElementById('decreaseFont');
const increaseFontBtn = document.getElementById('increaseFont');

let fontSize = 20;

decreaseFontBtn.addEventListener('click', () => {
  fontSize = Math.max(10, fontSize - 2);
  cheatInfoText.style.fontSize = fontSize + 'px';
});

increaseFontBtn.addEventListener('click', () => {
  fontSize = Math.min(40, fontSize + 2);
  cheatInfoText.style.fontSize = fontSize + 'px';
});

const infoPanelArrow = document.getElementById('infoPanelArrow');
let animationCount = 0;
let animationRunning = false;

function initializeArrow() {
  infoPanelArrow.style.position = 'fixed';
  infoPanelArrow.style.top = '50%';
  infoPanelArrow.style.left = '35px';
  infoPanelArrow.style.transform = 'translateY(-50%) rotate(180deg)';
  infoPanelArrow.style.opacity = 0;
  infoPanelArrow.style.top = 'calc(50% + 15px)'
}

function animateArrow() {
  if (animationRunning) return;

  animationRunning = true;
  let opacity = 0;
  let fadeIn = true;

  const animationSpeed = 25;

  const animation = setInterval(() => {
    if (fadeIn) {
      opacity += 0.1;
      if (opacity >= 1) {
        fadeIn = false;
      }
    } else {
      opacity -= 0.1;
      if (opacity <= 0) {
        fadeIn = true;
        animationCount++;
        if (animationCount >= 10) {
          clearInterval(animation);
          animationRunning = false;
          infoPanelArrow.style.opacity = 0;
        }
      }
    }

    infoPanelArrow.style.opacity = opacity;
  }, animationSpeed);
}

initializeArrow();
animateArrow();

function sandboxHack() {
function activateMain(temp1) {
  const hack = {
    keyBindings: {
      isCPressed: false,
      cTimer: null,
      isZPressed: false
    },
    playerMoveData: {
      lastHorizontalDirection: 1,
      isDashingDown: false,
      isDashingUp: false,
      lastDashTime: 0,
      dashDuration: 100,
      dashEndTime: 0,
      isDoubleJumpAllowed: false,
      airDashAvailable: true,
      newMovementIsOn: true,
    },
    bindKeys: function () {
      document.addEventListener('keydown', function (event) {
        if (event.key === 'Escape') {
          const panel = document.getElementById('someData')
          const panel1 = document.getElementById('controlPanel')
          if (panel.style.display === 'none') {
            panel.style.display = 'inherit'
          } else {
            panel.style.display = 'none'
          }
          if (panel1.style.display === 'none') {
            panel1.style.display = 'inherit'
          } else {
            panel1.style.display = 'none'
          }
        }
        if (event.key.toLowerCase() === 's' && event.repeat) {
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.mass = 3
          }
        }
        if (event.key.toLowerCase() === 'z' && !event.repeat) {
          hack.keyBindings.isZPressed = true
        } else if (event.repeat) {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = true
          if (!hack.keyBindings.cTimer) {
            hack.keyBindings.cTimer = setTimeout(() => {
              hack.keyBindings.isCPressed = false
              hack.keyBindings.cTimer = null
            }, 250)
          }
        }
      })
      document.addEventListener('keyup', function (event) {
        if (event.key.toLowerCase() === 's') {
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.mass = 1
          }
        }
        if (event.key.toLowerCase() === 'z') {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = false
          if (hack.keyBindings.cTimer) {
            clearTimeout(hack.keyBindings.cTimer)
            hack.keyBindings.cTimer = null
          }
        }
      })
    },
    getters: {
      get client() { return temp1[38].exports },
      get gf() { return temp1[42].exports },
      get gp() { return temp1[43].exports },
      get graphics() { return temp1[44].exports },
      get mode() { return temp1[48].exports },
      get envirData() { return temp1[53].exports },
      get network() { return temp1[66].exports },
      get physics() { return temp1[362].exports },
      get me() { return hack.getters.mode.player.gpData },
      get ray() { return hack.getters.me.ray },
      get velocity() { return hack.getters.me.p.velocity },
      get otherPlayers() { return hack.getters.mode.otherPlayers },
      get velocity() { return this.mode.player.gpData.p.velocity },
      get otherPlayers() { return this.mode.otherPlayers },
      ghost: false,
      get me() { return hack.getters.mode.player.gpData },
      get ray() { return hack.getters.me.ray },
      get velocity() { return hack.getters.me.p.velocity },
      get otherPlayers() { return hack.getters.mode.otherPlayers }
    },
    vars: {
      get isGround() { return isGrounded() },
      mult: 1,
      lrSpd: 3,
      udSpd: 3,
      'POSITION INFO ': '-----------------------',
      get currentPosX() { return Math.round(hack.getters.me.getX() * 100) / 100 },
      get currentPosY() { return Math.round(hack.getters.me.getY() * 100) / 100 },
      'SPEED INFO ': '----------------------------',
      get totalSpd() { return (((this.lrSpd + this.udSpd) / 2) * this.mult) },
      get currentSpdX() { return Math.round(hack.getters.me.p.velocity[0] * 100) / 100 },
      get currentSpdY() { return Math.round(hack.getters.me.p.velocity[1] * 100) / 100 },
      'SCRIPT VALUES ': '----------------------',
      multSpdIsOn: false,
      modeIsOn: false,
      ghost1: false,
      'MOVEMENT VALUES ': '---------------'
    },
    suppFuncs: {
      getMult: () => {
        if (hack.vars.mult < 3) {
          return 1
        } else if (hack.vars.mult < 4) {
          return 2
        }
      },
      setMult: function (e) {
        if (e != undefined) {
          hack.vars.lrSpd = hack.vars.udSpd = e
          return
        }
        if (hack.suppFuncs.getMult() === 1) {
          hack.vars.mult++
        } else if (hack.suppFuncs.getMult() === 2) {
          hack.vars.mult += 2
        } else {
          hack.vars.mult = 1
        }
      },
      getIndexByName: function (playerName) {
        const index = hack.getters.otherPlayers.findIndex(player => player?.myName === playerName)
        return index === -1 ? false : index
      }
    },
    functions: {
      godModeEnable: () => {
        hack.vars.ghost1 = true
        hack.getters.me.p.collisionResponse = false
        hack.getters.me.p.mass = 0
        hack.vars.modeIsOn = true
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      godModeDisable: () => {
        hack.vars.ghost1 = false
        hack.getters.me.p.collisionResponse = true
        hack.getters.me.p.mass = 1
        hack.vars.modeIsOn = false
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      multSpdEnable: () => {
        hack.vars.lrSpd *= hack.vars.mult
        hack.vars.udSpd *= hack.vars.mult
        hack.vars.multSpdIsOn = true
      },
      multSpdDisable: () => {
        hack.vars.lrSpd /= hack.vars.mult
        hack.vars.udSpd /= hack.vars.mult
        hack.vars.multSpdIsOn = false
      }
    },
    logFuncs: {
      logModeIsOn: () => {
        console.log('modeIsOn:', hack.vars.modeIsOn)
      },
      logSpd: () => {
        console.log('speed:', ((hack.vars.lrSpd + hack.vars.udSpd) / 2) * hack.vars.mult)
      }
    }
  }

  document.body.insertAdjacentHTML("beforebegin", `
  <div id="someData" style="display: inherit; width: auto; position: fixed; top: 0px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;"></div>
`)

  const updateData = () => {
    const o = []
    for (let i in hack.vars) {
      o.push(`${i}: ${hack.vars[i]}`)
    }
    for (let i in hack.playerMoveData) {
      o.push(`${i}: ${hack.playerMoveData[i]}`)
    }
    document.getElementById("someData").innerHTML = o.join('<br>')
  }

  document.body.insertAdjacentHTML("beforebegin", `
  <div id="controlPanel" style="display: inherit; width: auto; position: fixed; bottom: 0px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;">
    <div>
      <span>new movement: </span>
      <button id="newMoveBtn" style="background: rgba(255, 255, 255, 0.7); color: black;">${hack.playerMoveData.newMovementIsOn}</button>
    </div>
  </div>
`)

  const updateButtonStates = () => {
    document.getElementById("newMoveBtn").innerText = hack.playerMoveData.newMovementIsOn
  }

  document.getElementById("newMoveBtn").addEventListener("click", () => {
    if (!hack.playerMoveData.newMovementIsOn) {
      newMovement()
    } else {
      oldMovement()
    }
    updateButtonStates()
  })

  setInterval(updateData, 100 / 6)
  updateButtonStates()
  setInterval(updateButtonStates, 100 / 6)
  hack.bindKeys()

  let scrActivate = function () {
    hack.getters.client.loopFunctions[2].timeOut = 100 / 6
    hack.getters.client.loopFunctions[3].timeOut = 0
    oldMovement()
    Object.defineProperty(hack.vars, 'mult', { enumerable: false })
    Object.defineProperty(hack.vars, 'lrSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'udSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'multSpdIsOn', { enumerable: false })
    Object.defineProperty(hack.vars, 'ghost1', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastHorizontalDirection', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashDuration', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashEndTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'newMovementIsOn', { enumerable: false })
  }

  hack.getters.client.findUntilFound = function (e, t, n) {
    hack.getters.network.gsip = e;
    hack.getters.network.gsrn = t;
    hack.getters.network.getSID?.((sid) => {
      hack.getters.network.sid = sid;
      hack.getters.network.connectToGs?.(hack.getters.network.gsip, () => {
        console.log("connected to gs");

        hack.getters.client.verifyIsHuman?.(() => {
          hack.getters.network.registerSidOnGs?.((verifyStatus) => {
            console.log("verified on gs server", verifyStatus);

            if (verifyStatus === "") {
              alert("You are already playing the game in another browser tab.");
              location.reload();
              n(2);
            } else {
              hack.getters.network.joinRoom?.(hack.getters.network.gsrn, (joinStatus) => {
                if (joinStatus === 1) {
                  hack.getters.client.sendPlayingInfo?.(hack.getters.client.roomId, () => {
                    hack.getters.client.onReady?.();
                    n(1);
                    scrActivate()
                  });
                } else {
                  console.log("else");
                  hack.getters.network.gsSockehack?.getters.client.disconnect?.();

                  do {
                    hack.getters.client.rIndex++;
                    const currentDataCenter = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex];

                    if (!currentDataCenter?.[hack.getters.client.rIndex]) {
                      hack.getters.client.dcIndex++;
                      hack.getters.client.rIndex = 0;

                      if (!hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]) {
                        alert("It seems all servers are full. Please refresh your page and try again.");
                        location.reload();
                        return;
                      }
                    }
                  } while (hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[2] !== hack.getters.client.modeInfo.mp);

                  const newGsip = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[1];
                  const newGsrn = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[3];
                  hack.getters.client.roomId = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[4];

                  hack.getters.client.findUntilFound(newGsip, newGsrn, n);
                }
              });
            }
          });
        });
      });
    });
  };

  document.body.onkeydown = (event) => {
    const keyCode = event.keyCode
    switch (keyCode) {
      case 17:
        hack.getters.mode.makeMeGhost()
        break
      case 113:
        if (!hack.vars.modeIsOn) {
          hack.functions.godModeEnable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdEnable()
        } else {
          hack.functions.godModeDisable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdDisable()
        }
        break
      case 192:
      case 190:
        if (hack.vars.modeIsOn) {
          hack.suppFuncs.setMult()
          hack.logFuncs.logSpd()
        }
        break
    }
  }

  function isGrounded() {
    const meX = hack.getters.me.getX()
    const meY = hack.getters.me.getY()
    const ray = hack.getters.ray
    const physics = hack.getters.physics
    const gpPWorld = hack.getters.gp.pWorld
    const rayResult = hack.getters.me.ray.result
    const rayHitPoint = (hack.getters.ray.hitPoint = [Infinity, Infinity])

    const verticalOffset = 50
    const checkYPosition = meY + 45

    for (let i = 0; i < 121; i++) {
      const o = meX - 15 + i * (30 / 120)
      const s = checkYPosition
      const u = s + verticalOffset

      ray.from = [physics.xAxis(o, 0), physics.yAxis(s, 0)]
      ray.to = [physics.xAxis(o, 0), physics.yAxis(u, 0)]

      ray.update()
      rayResult.reset()

      if (gpPWorld.raycast(rayResult, ray)) {
        rayResult.getHitPoint(rayHitPoint, ray)
        const hitDistance = rayResult.getHitDistance(ray)

        if (rayResult.shape.ref.getCollision() && hitDistance < 0.1) {
          return true
        }
      }
    }

    return false
  }

  function newMovement() {
    hack.getters.client.loopFunctions[2].fun = function () {
      const currentTime = Date.now()
      const dashCooldown = 250
      const dashDistance = 2.5
      const dashSpeed = 25
      const grounded = isGrounded()

      if (grounded) {
        hack.playerMoveData.airDashAvailable = true
      }

      if (hack.getters.mode.moveLeft) {
        hack.playerMoveData.lastHorizontalDirection = -1
      } else if (hack.getters.mode.moveRight) {
        hack.playerMoveData.lastHorizontalDirection = 1
      }

      if (
        hack.keyBindings.isCPressed &&
        hack.getters.mode.moveDown &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashingDown &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashingDown = true
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (
        hack.keyBindings.isCPressed &&
        hack.getters.mode.moveUp &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashingUp &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashingUp = true
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (
        hack.keyBindings.isCPressed &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashing &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashing = true
        hack.playerMoveData.dashVelocity = dashSpeed * hack.playerMoveData.lastHorizontalDirection
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (hack.playerMoveData.isDashingDown) {
        hack.getters.mode.player.gpData.p.velocity[1] = -dashSpeed
        hack.getters.mode.player.gpData.p.velocity[0] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashingDown = false
          hack.getters.mode.player.gpData.p.velocity[1] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      }

      if (hack.playerMoveData.isDashingUp) {
        hack.getters.mode.player.gpData.p.velocity[1] = dashSpeed
        hack.getters.mode.player.gpData.p.velocity[0] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashingUp = false
          hack.getters.mode.player.gpData.p.velocity[1] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      }

      if (hack.playerMoveData.isDashing) {
        hack.getters.mode.player.gpData.p.velocity[0] = hack.playerMoveData.dashVelocity
        hack.getters.mode.player.gpData.p.velocity[1] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashing = false
          hack.getters.mode.player.gpData.p.velocity[0] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      } else {
        if (hack.getters.mode.moveRight) {
          hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
        } else if (hack.getters.mode.moveLeft) {
          hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
        }
      }

      if (grounded) {
        hack.playerMoveData.isDoubleJumpAllowed = true
        if (hack.keyBindings.isZPressed) {
          hack.keyBindings.isZPressed = false
          hack.getters.velocity[1] = 8 * (hack.getters.me.p.gravityScale)
        }
      } else if (hack.playerMoveData.isDoubleJumpAllowed && hack.keyBindings.isZPressed) {
        hack.keyBindings.isZPressed = false
        hack.getters.velocity[1] = 8 * (hack.getters.me.p.gravityScale)
        hack.playerMoveData.isDoubleJumpAllowed = false
      }

      if (hack.vars.ghost1) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
        }
        if (hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
        }
        if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = 0
        }
      }
    }
    hack.playerMoveData.newMovementIsOn = true
  }

  function oldMovement() {
    hack.getters.client.loopFunctions[2].fun = function () {
      const grounded = isGrounded()

      if (hack.getters.mode.moveRight) {
        hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
      } else if (hack.getters.mode.moveLeft) {
        hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
      }
      if (grounded) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = 8
        }
      }
      if (hack.vars.ghost1) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
        }
        if (hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
        }
        if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = 0
        }
      }
    }
    hack.playerMoveData.newMovementIsOn = false}

addEventListener("mousewheel", e => {
    window.tweenObjects.map(x => {
        try {
            if (e.shiftKey) {
                hack.getters.mode.player.gpData.p.velocity[0] = -Math.sign(e.deltaY) * 15;
            } else {
                hack.getters.mode.player.gpData.p.velocity[1] = -Math.sign(e.deltaY) * 15;
            }
        } catch (err) {
            console.error(err);
        }
    });
});

}

let temp1 = {};
const _call = Function.prototype.call;
new Promise((resolve, reject) => {
  Function.prototype.call = function (...args) {
    if (args[2]?.exports) {
      temp1 = args[6]
      Function.prototype.call = _call
      console.log(temp1)
      resolve(temp1)
    }
    return _call.apply(this, args)
  };
}).then((result) => {
  if (Object.keys(result).length > 0) {
    activateMain(result)
  } else {
    console.log("temp1 is empty")
  }
}).catch((error) => {
  console.error("An error occurred:", error)
})
}

function twoPlayerHack() {
function activateMain(temp1) {
  const hack = {
    keyBindings: {
      isCPressed: false,
      cTimer: null,
      isZPressed: false
    },
    playerMoveData: {
      lastHorizontalDirection: 1,
      isDashingDown: false,
      isDashingUp: false,
      lastDashTime: 0,
      dashDuration: 100,
      dashEndTime: 0,
      isDoubleJumpAllowed: false,
      airDashAvailable: true,
      newMovementIsOn: true,
      division: 120,
      meYplus: 45,
    },
    bindKeys: function () {
      document.addEventListener('keydown', function (event) {
          if (event.key === 'Escape') {
              const panel = document.getElementById('someData')
              const panel1 = document.getElementById('controlPanel')
                  if (panel.style.display === 'none') {
                      panel.style.display = 'inherit'
        } else {
          panel.style.display = 'none'
                  }
                  if (panel1.style.display === 'none') {
                      panel1.style.display = 'inherit'
        } else {
          panel1.style.display = 'none'
                  }
          }
        if (event.key.toLowerCase() === 's' && event.repeat) {
            if (!hack.vars.modeIsOn) {
                hack.getters.me.p.mass = 3
            }
        }
        if (event.key.toLowerCase() === 'z' && !event.repeat) {
          hack.keyBindings.isZPressed = true
        } else if (event.repeat) {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = true
          if (!hack.keyBindings.cTimer) {
            hack.keyBindings.cTimer = setTimeout(() => {
              hack.keyBindings.isCPressed = false
              hack.keyBindings.cTimer = null
            }, 250)
          }
        }
      })
      document.addEventListener('keyup', function (event) {
        if (event.key.toLowerCase() === 's') {
            if (!hack.vars.modeIsOn) {
                hack.getters.me.p.mass = 1
            }
        }
        if (event.key.toLowerCase() === 'z') {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = false
          if (hack.keyBindings.cTimer) {
            clearTimeout(hack.keyBindings.cTimer)
            hack.keyBindings.cTimer = null
          }
        }
      })
    },
    getters: {
      get client() { return temp1[38].exports },
      get gf() { return temp1[42].exports },
      get gp() { return temp1[43].exports },
      get graphics() { return temp1[44].exports },
      get mode() { return temp1[48].exports },
      get envirData() { return temp1[52].exports },
      get rGho() { return temp1[63].exports },
      get modules_resultScreen() { return temp1[72].exports },
      get network() { return temp1[73].exports },
      get physics() { return temp1[369].exports },
      get me() { return hack.getters.mode.player.gpData },
      get ray() { return hack.getters.me.ray },
      get velocity() { return hack.getters.me.p.velocity },
      get otherPlayers() { return hack.getters.mode.otherPlayers },
    },
    vars: {
      get isGround() {return isGrounded()},
      mult: 1,
      lrSpd: 3,
      udSpd: 3,
      'POSITION INFO ': '-----------------------',
      get currentPosX() {return Math.round(hack.getters.me.getX()*100)/100},
      get currentPosY() {return Math.round(hack.getters.me.getY()*100)/100},
      pX: 0,
      pY: 0,
	  'SPEED INFO ': '----------------------------',
      get totalSpd() {return (((this.lrSpd + this.udSpd) / 2) * this.mult)},
      get currentSpdX() {return Math.round(hack.getters.me.p.velocity[0]*100)/100},
      get currentSpdY() {return Math.round(hack.getters.me.p.velocity[1]*100)/100},
	  'SCRIPT VALUES ': '----------------------',
      multSpdIsOn: false,
      modeIsOn: false,
      immIsOn: false,
      MMGIsOn: false,
      interTpToOtherIsOn: false,
      ghost1: false,
      ghost2: false,
      isPlayerDead: false,
      tpSpawnCounter: 0,
      'MOVEMENT VALUES ': '---------------',
    },
    suppFuncs: {
      getMult: () => {
        if (hack.vars.mult < 3) {
          return 1
        } else if (hack.vars.mult < 4) {
          return 2
        }
      },
      setMult: function (e) {
        if (e != undefined) {
          hack.vars.lrSpd = hack.vars.udSpd = e
          return
        }
        if (hack.suppFuncs.getMult() === 1) {
          hack.vars.mult++
        } else if (hack.suppFuncs.getMult() === 2) {
          hack.vars.mult += 2
        } else {
          hack.vars.mult = 1
        }
      },
      getIndexByName: function(playerName) {
        const index = hack.getters.otherPlayers.findIndex(player => player?.myName === playerName)
        return index === -1 ? false : index
      }
    },
    functions: {
      prevPos: function () {
          hack.vars.pX = hack.getters.mode.player.gpData.getX()
          hack.vars.pY = hack.getters.mode.player.gpData.getY()
      },
      tpSpawn: function () {
        if (hack.vars.tpSpawnCounter == 0) {
          this.tp(hack.vars.pX,hack.vars.pY); hack.vars.tpSpawnCounter++
          return
        } else if (hack.vars.tpSpawnCounter == 1) {this.tp(
          hack.getters.mode.spawn.refP.getX(),
          hack.getters.mode.spawn.refP.getY()
        )} hack.vars.tpSpawnCounter = 0
      },
      tpDoor: function () {
        this.prevPos()
        hack.vars.tpSpawnCounter = 0
        this.tp(
          hack.getters.mode.exitGate.exitGateCounter.refP.getX(),
          hack.getters.mode.exitGate.exitGateCounter.refP.getY()
        )
      },
      tp: function (x,y) {
        hack.getters.mode.player.gpData.setX(x)
        hack.getters.mode.player.gpData.setY(y)
      },
      setTpToOther: function (playerIndex) {
        if (!hack.vars.interTpToOtherIsOn && playerIndex !== false) {
          this.interTpToOther = setInterval(() => {
            hack.getters.me.p.position[0] = hack.getters.otherPlayers[playerIndex].gpData.p.position[0]
            hack.getters.me.p.position[1] = hack.getters.otherPlayers[playerIndex].gpData.p.position[1]
          }, 100 / 14.4)
          hack.vars.interTpToOtherIsOn = true
        } else if (playerIndex === false) {
          try {
            clearInterval(this.interTpToOther)
            hack.vars.interTpToOtherIsOn = false
          } catch {
            console.log('не существующий интервал')
          }
        }
      },
      MMGEnable: function () {
        hack.getters.mode.makeMeGhost = function () {
          hack.getters.me.setAlpha(0.3)
          hack.getters.me.p.shapes[0].sensor = true
          hack.getters.me.p.gravityScale = 0
          hack.getters.velocity[0] = 0
          hack.getters.velocity[1] = 0
          hack.getters.me.me = void 0
          hack.vars.ghost2 = true
          hack.vars.isPlayerDead = true
          hack.getters.rGho.fire(hack.getters.network.gsSocket)
          if (hack.getters.mode.md.mobile()) {hack.getters.mode.setupTouchButtons(true)}
        }
        hack.vars.MMGIsOn = true
      },
      MMGDisable: function () {
        hack.getters.mode.makeMeGhost = () => { }
        hack.vars.MMGIsOn = false
      },
      immEnable: () => {
        hack.getters.me.me = void 0
        hack.vars.immIsOn = true
      },
      immDisable: () => {
        hack.getters.me.me = true
        hack.vars.immIsOn = false
      },
      godModeEnable: () => {
        hack.vars.ghost1 = true
        hack.getters.me.p.collisionResponse = false
        hack.getters.me.p.mass = 0
        hack.vars.modeIsOn = true
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      godModeDisable: () => {
        hack.vars.ghost1 = false
        hack.getters.me.p.collisionResponse = true
        hack.getters.me.p.mass = 1
        hack.vars.modeIsOn = false
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      multSpdEnable: () => {
        hack.vars.lrSpd *= hack.vars.mult
        hack.vars.udSpd *= hack.vars.mult
        hack.vars.multSpdIsOn = true
      },
      multSpdDisable: () => {
        hack.vars.lrSpd /= hack.vars.mult
        hack.vars.udSpd /= hack.vars.mult
        hack.vars.multSpdIsOn = false
      }
    },
    logFuncs: {
      logModeIsOn: () => {
        console.log('modeIsOn:', hack.vars.modeIsOn)
      },
      logImmIsOn: () => {
        console.log('immIsOn:', hack.vars.immIsOn)
      },
      logSpd: () => {
        console.log('speed:', ((hack.vars.lrSpd + hack.vars.udSpd) / 2) * hack.vars.mult)
      },
      logMMGIsOn: () => {
        console.log('MMGIsOn:', hack.vars.MMGIsOn)
      }
    }
  }

document.body.insertAdjacentHTML("beforebegin", `
  <div id="someData" style="display: inherit; width: auto; position: fixed; top: 25px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;"></div>
`)

const updateData = () => {
  const o = []
  for (let i in hack.vars) {
    o.push(`${i}: ${hack.vars[i]}`)
  }
  for (let i in hack.playerMoveData) {
    o.push(`${i}: ${hack.playerMoveData[i]}`)
  }
  document.getElementById("someData").innerHTML = o.join('<br>')
}

setInterval(updateData, 100 / 6)

document.body.insertAdjacentHTML("beforebegin", `
  <div id="controlPanel" style="display: inherit; width: auto; position: fixed; bottom: 0px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;">
    <div>
      <span>new movement: </span>
      <button id="newMoveBtn" style="background: rgba(255, 255, 255, 0.7); color: black;">${hack.playerMoveData.newMovementIsOn}</button>
    </div>
    <div>
      <span>poison immunity: </span>
      <button id="immBtn" style="background: rgba(255, 255, 255, 0.7); color: black;">${hack.vars.immIsOn}</button>
    </div>
    <div>
      <span>death immunity: </span>
      <button id="MMGBtn" style="background: rgba(255, 255, 255, 0.7); color: black;">${!hack.vars.MMGIsOn}</button>
    </div>
  </div>
`)

const updateButtonStates = () => {
  document.getElementById("newMoveBtn").innerText = hack.playerMoveData.newMovementIsOn
  document.getElementById("immBtn").innerText = hack.vars.immIsOn
  document.getElementById("MMGBtn").innerText = !hack.vars.MMGIsOn
}

document.getElementById("newMoveBtn").addEventListener("click", () => {
  if (!hack.playerMoveData.newMovementIsOn) {
    newMovement()
  } else {
    oldMovement()
  }
  updateButtonStates()
})

document.getElementById("immBtn").addEventListener("click", () => {
  if (hack.vars.immIsOn) {
    hack.functions.immDisable()
  } else {
    hack.functions.immEnable()
  }
  updateButtonStates()
})

document.getElementById("MMGBtn").addEventListener("click", () => {
  if (hack.vars.MMGIsOn) {
    hack.functions.MMGDisable()
  } else {
    hack.functions.MMGEnable()
  }
  updateButtonStates()
})

updateButtonStates()

setInterval(updateButtonStates, 100 / 6)

  hack.functions.MMGDisable()

  let scrActivate = function() {
    hack.getters.client.loopFunctions[2].timeOut = 100 / 6
    newMovement()
    Object.defineProperty(hack.vars, 'mult', { enumerable: false })
    Object.defineProperty(hack.vars, 'lrSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'udSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'ghost2', { enumerable: false })
    Object.defineProperty(hack.vars, 'pX', { enumerable: false })
    Object.defineProperty(hack.vars, 'pY', { enumerable: false })
    Object.defineProperty(hack.vars, 'tpSpawnCounter', { enumerable: false })
    Object.defineProperty(hack.vars, 'multSpdIsOn', { enumerable: false })
    Object.defineProperty(hack.vars, 'ghost1', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastHorizontalDirection', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashDuration', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashEndTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'newMovementIsOn', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'division', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'meYplus', { enumerable: false })
    document.getElementById('timer').style.background = 'rgb(0, 0, 0)'
    document.getElementById('timer').style.color = 'rgb(255, 255, 255)'
    document.getElementById('mapCredits').style.background = 'rgb(0, 0, 0)'
    document.getElementById('mapCredits').style.color = 'rgb(255, 255, 255)'
    document.getElementById('leaderboard').style.background = 'rgb(0, 0, 0)'
    document.getElementById('timer').style.opacity = 0.7
    document.getElementById('leaderboard').style.opacity = 0.7
    document.getElementById('mapCredits').style.opacity = 0.7
  }

  hack.bindKeys()

  hack.getters.mode.onChangeMap = function (e) {
    try {
      scrActivate()
      scrActivate = null
    } catch {}
    clearInterval(hack.getters.mode.startTimeId)
    clearTimeout(hack.getters.mode.smallStepTimeId)
    hack.getters.modules_resultScreen.hideResultScreen()
    hack.getters.gp.unload(hack.getters.gp)
    hack.getters.gp.list = hack.getters.gp.load(e, hack.getters.gp)
    hack.getters.mode.syncArr = []
    hack.getters.mode.ghost = false
    hack.getters.mode.tweenObjects = []
    hack.getters.mode.defineBehaviours(hack.getters.gp.list, hack.getters.mode.syncArr, hack.getters.gp)
    if (hack.getters.mode.md.mobile()) {
      hack.getters.mode.setupTouchButtons(false)
    }
    hack.getters.mode.setMyBio()
    hack.getters.mode.setBio(hack.getters.me, hack.getters.mode.myName, hack.getters.mode.mySkin, hack.getters.mode.whatBro, hack.getters.mode.chatColor, hack.getters.mode.teamColor)
    for (let n = 0; n < hack.getters.otherPlayers.length; n++) {
      if (hack.getters.otherPlayers[n]) {
        let t = hack.getters.otherPlayers[n].gpData.g.myIndex
        hack.getters.otherPlayers[n].gpData = hack.getters.mode.createPlayer()
        hack.getters.otherPlayers[n].gpData.g.myIndex = t
        hack.getters.gp.gWorld.removeChild(hack.getters.otherPlayers[n].gpData.g)
        hack.getters.gp.gWorld.mid.addChild(hack.getters.otherPlayers[n].gpData.g)
        hack.getters.mode.setBio(
          hack.getters.otherPlayers[n].gpData,
          hack.getters.otherPlayers[n].myName,
          hack.getters.otherPlayers[n].mySkin,
          hack.getters.otherPlayers[n].whatBro,
          hack.getters.otherPlayers[n].chatColor,
          hack.getters.otherPlayers[n].teamColor
        )
      }
    }
    hack.getters.mode.firstTimeMapChange = hack.getters.mode.firstTimeMapChange || true
    hack.getters.mode.smallStepTimeId = setTimeout(function () {
      document.getElementById("startTime").style.display = "inherit"
      document.getElementById("startTime").innerHTML = hack.getters.mode.startTime
      hack.getters.client.runPhysics = false
      hack.getters.mode.startTimeId = setInterval(function () {
        hack.getters.mode.startTime++
        document.getElementById("startTime").innerHTML = hack.getters.mode.startTime
        if (hack.getters.mode.startTime == 3) {
          hack.getters.mode.startTime = 0
          hack.getters.client.runPhysics = true
          clearInterval(hack.getters.mode.startTimeId)
          document.getElementById("startTime").style.display = "none"
        }
      }, 1000)
    }, 0)
    hack.getters.me.me = true
    if (hack.vars.modeIsOn) {
      hack.functions.godModeEnable()
    } else {
      hack.functions.godModeDisable()
    }
    if (hack.vars.immIsOn) {
      hack.functions.immEnable()
    } else {
      hack.functions.immDisable()
    }
    hack.vars.ghost2 = false
    hack.vars.isPlayerDead = false
  }

  document.body.onkeydown = (event) => {
    const keyCode = event.keyCode
    switch (keyCode) {
      case 17:
        hack.getters.mode.makeMeGhost()
        break
      case 113:
        if (!hack.vars.modeIsOn) {
          hack.functions.godModeEnable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdEnable()
        } else {
          hack.functions.godModeDisable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdDisable()
        }
        break
      case 36:
        hack.functions.tpSpawn()
        break
      case 35:
        hack.functions.tpDoor()
        break
      case 120:
        if (!hack.vars.MMGIsOn) {
          hack.functions.MMGEnable()
          hack.logFuncs.logMMGIsOn()
        } else {
          hack.functions.MMGDisable()
          hack.logFuncs.logMMGIsOn()
        }
        break
      case 192:
      case 190:
        if (hack.vars.modeIsOn) {
          hack.suppFuncs.setMult()
          hack.logFuncs.logSpd()
        }
        break
      case 45:
      case 96:
        hack.functions.setTpToOther(hack.suppFuncs.getIndexByName(prompt('Введите корректный никнейм. Чтобы выйти из интервала нажмите Esc.')))
        break
      case 115:
        if (!hack.vars.immIsOn) {
          hack.functions.immEnable()
          hack.logFuncs.logImmIsOn()
        } else {
          hack.functions.immDisable()
          hack.logFuncs.logImmIsOn()
        }
        break
    }
  }

function isGrounded() {
    const meX = hack.getters.me.getX()
    const meY = hack.getters.me.getY()
    const ray = hack.getters.ray
    const physics = hack.getters.physics
    const gpPWorld = hack.getters.gp.pWorld
    const rayResult = hack.getters.me.ray.result
    const rayHitPoint = (hack.getters.ray.hitPoint = [Infinity, Infinity])
    const division = hack.playerMoveData.division
    const meYplus = hack.playerMoveData.meYplus

    const verticalOffset = 50
    const checkYPosition = meY + meYplus

    for (let i = 0; i < division+1; i++) {
        const o = meX - 15 + i * (30 / division)
        const s = checkYPosition
        const u = s + verticalOffset

        ray.from = [physics.xAxis(o, 0), physics.yAxis(s, 0)]
        ray.to = [physics.xAxis(o, 0), physics.yAxis(u, 0)]

        ray.update()
        rayResult.reset()

        if (gpPWorld.raycast(rayResult, ray)) {
            rayResult.getHitPoint(rayHitPoint, ray)
            const hitDistance = rayResult.getHitDistance(ray)

            if (rayResult.shape.ref.getCollision() && hitDistance < 0.1) {
                return true
            }
        }
    }

    return false
}

function newMovement() {
    hack.playerMoveData.division = 120
    hack.playerMoveData.meYplus = 45
hack.getters.client.loopFunctions[2].fun = function() {
  const currentTime = Date.now()
  const dashCooldown = 250
  const dashDistance = 2.5
  const dashSpeed = 25
  const grounded = isGrounded()

  if (grounded) {
    hack.playerMoveData.airDashAvailable = true
  }

  if (hack.getters.mode.moveLeft) {
    hack.playerMoveData.lastHorizontalDirection = -1
  } else if (hack.getters.mode.moveRight) {
    hack.playerMoveData.lastHorizontalDirection = 1
  }

  if (
    hack.keyBindings.isCPressed &&
    hack.getters.mode.moveDown &&
    currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
    !hack.playerMoveData.isDashingDown &&
    (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
  ) {
    hack.playerMoveData.lastDashTime = currentTime
    hack.playerMoveData.isDashingDown = true
    hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
    hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
    if (!grounded) {
      hack.playerMoveData.airDashAvailable = false
    }
  }

  if (
    hack.keyBindings.isCPressed &&
    hack.getters.mode.moveUp &&
    currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
    !hack.playerMoveData.isDashingUp &&
    (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
  ) {
    hack.playerMoveData.lastDashTime = currentTime
    hack.playerMoveData.isDashingUp = true
    hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
    hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
    if (!grounded) {
      hack.playerMoveData.airDashAvailable = false
    }
  }

  if (
    hack.keyBindings.isCPressed &&
    currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
    !hack.playerMoveData.isDashing &&
    (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
  ) {
    hack.playerMoveData.lastDashTime = currentTime
    hack.playerMoveData.isDashing = true
    hack.playerMoveData.dashVelocity = dashSpeed * hack.playerMoveData.lastHorizontalDirection
    hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
    hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
    if (!grounded) {
      hack.playerMoveData.airDashAvailable = false
    }
  }

  if (hack.playerMoveData.isDashingDown) {
    hack.getters.mode.player.gpData.p.velocity[1] = -dashSpeed
    hack.getters.mode.player.gpData.p.velocity[0] = 0
    hack.getters.me.p.collisionResponse = false
    if (currentTime >= hack.playerMoveData.dashEndTime) {
      hack.playerMoveData.isDashingDown = false
      hack.getters.mode.player.gpData.p.velocity[1] = 0
      if (!hack.vars.modeIsOn) {
        hack.getters.me.p.collisionResponse = true
      }
    }
    return
  }

  if (hack.playerMoveData.isDashingUp) {
    hack.getters.mode.player.gpData.p.velocity[1] = dashSpeed
    hack.getters.mode.player.gpData.p.velocity[0] = 0
    hack.getters.me.p.collisionResponse = false
    if (currentTime >= hack.playerMoveData.dashEndTime) {
      hack.playerMoveData.isDashingUp = false
      hack.getters.mode.player.gpData.p.velocity[1] = 0
      if (!hack.vars.modeIsOn) {
        hack.getters.me.p.collisionResponse = true
      }
    }
    return
  }

  if (hack.playerMoveData.isDashing) {
    hack.getters.mode.player.gpData.p.velocity[0] = hack.playerMoveData.dashVelocity
    hack.getters.mode.player.gpData.p.velocity[1] = 0
    hack.getters.me.p.collisionResponse = false
    if (currentTime >= hack.playerMoveData.dashEndTime) {
      hack.playerMoveData.isDashing = false
      hack.getters.mode.player.gpData.p.velocity[0] = 0
      if (!hack.vars.modeIsOn) {
        hack.getters.me.p.collisionResponse = true
      }
    }
    return
  } else {
    if (hack.getters.mode.moveRight) {
      hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
    } else if (hack.getters.mode.moveLeft) {
      hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
    }
  }

  if (grounded) {
    hack.playerMoveData.isDoubleJumpAllowed = true
    if (hack.keyBindings.isZPressed) {
      hack.keyBindings.isZPressed = false
      hack.getters.velocity[1] = 8*(hack.getters.me.p.gravityScale)
    }
  } else if (hack.playerMoveData.isDoubleJumpAllowed && hack.keyBindings.isZPressed) {
    hack.keyBindings.isZPressed = false
    hack.getters.velocity[1] = 8*(hack.getters.me.p.gravityScale)
    hack.playerMoveData.isDoubleJumpAllowed = false
  }

  if (hack.vars.ghost1 || hack.vars.ghost2) {
    if (hack.getters.mode.moveUp) {
      hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
    }
    if (hack.getters.mode.moveDown) {
      hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
    }
    if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
      hack.getters.velocity[1] = 0
    }
  }
}
hack.playerMoveData.newMovementIsOn = true}

function oldMovement() {
    hack.playerMoveData.division = 12
    hack.playerMoveData.meYplus = 49
hack.getters.client.loopFunctions[2].fun = function() {
    const grounded = isGrounded()

    if (hack.getters.mode.moveRight) {
      hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
    } else if (hack.getters.mode.moveLeft) {
      hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
    }
  if (grounded) {
    if (hack.getters.mode.moveUp) {
      hack.getters.velocity[1] = 8
    }
  }
  if (hack.vars.ghost1 || hack.vars.ghost2) {
    if (hack.getters.mode.moveUp) {
      hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
    }
    if (hack.getters.mode.moveDown) {
      hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
    }
    if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
      hack.getters.velocity[1] = 0
    }
  }
  }
hack.playerMoveData.newMovementIsOn = false}
addEventListener("mousewheel", e => {
    window.tweenObjects.map(x => {
        try {
            if (e.shiftKey) {
                hack.getters.mode.player.gpData.p.velocity[0] = -Math.sign(e.deltaY) * 15;
            } else {
                hack.getters.mode.player.gpData.p.velocity[1] = -Math.sign(e.deltaY) * 15;
            }
        } catch (err) {
            console.error(err);
        }
    });
});
function teleportToClick(event) {
    event.preventDefault()
    const gameWidthFactor = window.innerWidth / hack.getters.mode.horizontalFOV
    const gameHeightFactor = window.innerHeight / (hack.getters.mode.horizontalFOV * (window.innerHeight / window.innerWidth))
    const targetX = (hack.getters.me.g.x + (event.clientX - window.innerWidth / 2) / gameWidthFactor) / 100;
    const targetY = -(hack.getters.me.g.y - hack.getters.me.shapes[1].getHeight() / 2 + (event.clientY - window.innerHeight / 2) / gameHeightFactor) / 100
    hack.getters.me.p.position[0] = targetX
    hack.getters.me.p.position[1] = targetY
}
document.addEventListener("contextmenu", teleportToClick)
}

let temp1 = {};
const _call = Function.prototype.call;
new Promise((resolve, reject) => {
  Function.prototype.call = function (...args) {
    if (args[2]?.exports) {
      temp1 = args[6]
      Function.prototype.call = _call
      console.log(temp1)
      resolve(temp1)
    }
    return _call.apply(this, args)
  };
}).then((result) => {
  if (Object.keys(result).length > 0) {
    activateMain(result)
  } else {
    console.log("temp1 is empty")
  }
}).catch((error) => {
  console.error("An error occurred:", error)
})
}

function hideAndSeekHack() {
  function activateMain(temp1) {
  const hack = {
    keyBindings: {
      isCPressed: false,
      cTimer: null,
      isZPressed: false
    },
    playerMoveData: {
      lastHorizontalDirection: 1,
      isDashingDown: false,
      isDashingUp: false,
      lastDashTime: 0,
      dashDuration: 100,
      dashEndTime: 0,
      isDoubleJumpAllowed: false,
      airDashAvailable: true,
      newMovementIsOn: true
    },
    bindKeys: function () {
      document.addEventListener('keydown', function (event) {
        if (event.key === 'Escape') {
          const panel = document.getElementById('someData')
          const panel1 = document.getElementById('controlPanel')
          if (panel.style.display === 'none') {
            panel.style.display = 'inherit'
          } else {
            panel.style.display = 'none'
          }
          if (panel1.style.display === 'none') {
            panel1.style.display = 'inherit'
          } else {
            panel1.style.display = 'none'
          }
        }
        if (event.key.toLowerCase() === 's' && event.repeat) {
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.mass = 3
          }
        }
        if (event.key.toLowerCase() === 'z' && !event.repeat) {
          hack.keyBindings.isZPressed = true
        } else if (event.repeat) {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = true
          if (!hack.keyBindings.cTimer) {
            hack.keyBindings.cTimer = setTimeout(() => {
              hack.keyBindings.isCPressed = false
              hack.keyBindings.cTimer = null
            }, 250)
          }
        }
      })
      document.addEventListener('keyup', function (event) {
        if (event.key.toLowerCase() === 's') {
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.mass = 1
          }
        }
        if (event.key.toLowerCase() === 'z') {
          hack.keyBindings.isZPressed = false
        }
        if (event.key.toLowerCase() === 'c') {
          hack.keyBindings.isCPressed = false
          if (hack.keyBindings.cTimer) {
            clearTimeout(hack.keyBindings.cTimer)
            hack.keyBindings.cTimer = null
          }
        }
      })
    },
    getters: {
      get client() { return temp1[38].exports },
      get gf() { return temp1[42].exports },
      get gp() { return temp1[43].exports },
      get graphics() { return temp1[44].exports },
      get mode() { return temp1[48].exports },
      get envirData() { return temp1[53].exports },
      get network() { return temp1[74].exports },
      get physics() { return temp1[370].exports },
      get me() { return hack.getters.mode.player.gpData },
      get ray() { return hack.getters.me.ray },
      get velocity() { return hack.getters.me.p.velocity },
      get otherPlayers() { return hack.getters.mode.otherPlayers },
      get ray() { return this.mode.player.gpData.ray },
      get velocity() { return this.mode.player.gpData.p.velocity },
      get otherPlayers() { return this.mode.otherPlayers },
      ghost: false,
      get me() { return hack.getters.mode.player.gpData },
      get ray() { return hack.getters.me.ray },
      get velocity() { return hack.getters.me.p.velocity },
      get otherPlayers() { return hack.getters.mode.otherPlayers }
    },
    vars: {
      get isGround() { return isGrounded() },
      mult: 1,
      lrSpd: 3,
      udSpd: 3,
      'POSITION INFO ': '-----------------------',
      get currentPosX() { return Math.round(hack.getters.me.getX() * 100) / 100 },
      get currentPosY() { return Math.round(hack.getters.me.getY() * 100) / 100 },
      'SPEED INFO ': '----------------------------',
      get totalSpd() { return (((this.lrSpd + this.udSpd) / 2) * this.mult) },
      get currentSpdX() { return Math.round(hack.getters.me.p.velocity[0] * 100) / 100 },
      get currentSpdY() { return Math.round(hack.getters.me.p.velocity[1] * 100) / 100 },
      'SCRIPT VALUES ': '----------------------',
      multSpdIsOn: false,
      modeIsOn: false,
      ghost1: false,
      isPlayerDead: false,
      'MOVEMENT VALUES ': '---------------'
    },
    suppFuncs: {
      getMult: () => {
        if (hack.vars.mult < 3) {
          return 1
        } else if (hack.vars.mult < 4) {
          return 2
        }
      },
      setMult: function (e) {
        if (e != undefined) {
          hack.vars.lrSpd = hack.vars.udSpd = e
          return
        }
        if (hack.suppFuncs.getMult() === 1) {
          hack.vars.mult++
        } else if (hack.suppFuncs.getMult() === 2) {
          hack.vars.mult += 2
        } else {
          hack.vars.mult = 1
        }
      },
      getIndexByName: function (playerName) {
        const index = hack.getters.otherPlayers.findIndex(player => player?.myName === playerName)
        return index === -1 ? false : index
      }
    },
    functions: {
      godModeEnable: () => {
        hack.vars.ghost1 = true
        hack.getters.me.p.collisionResponse = false
        hack.getters.me.p.mass = 0
        hack.vars.modeIsOn = true
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      godModeDisable: () => {
        hack.vars.ghost1 = false
        hack.getters.me.p.collisionResponse = true
        hack.getters.me.p.mass = 1
        hack.vars.modeIsOn = false
        hack.getters.velocity[0] = 0
        hack.getters.velocity[1] = 0
      },
      multSpdEnable: () => {
        hack.vars.lrSpd *= hack.vars.mult
        hack.vars.udSpd *= hack.vars.mult
        hack.vars.multSpdIsOn = true
      },
      multSpdDisable: () => {
        hack.vars.lrSpd /= hack.vars.mult
        hack.vars.udSpd /= hack.vars.mult
        hack.vars.multSpdIsOn = false
      }
    },
    logFuncs: {
      logModeIsOn: () => {
        console.log('modeIsOn:', hack.vars.modeIsOn)
      },
      logSpd: () => {
        console.log('speed:', ((hack.vars.lrSpd + hack.vars.udSpd) / 2) * hack.vars.mult)
      }
    }
  }

  document.body.insertAdjacentHTML("beforebegin", `
  <div id="someData" style="display: inherit; width: auto; position: fixed; top: 25px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;"></div>
`)

  const updateData = () => {
    const o = []
    for (let i in hack.vars) {
      o.push(`${i}: ${hack.vars[i]}`)
    }
    for (let i in hack.playerMoveData) {
      o.push(`${i}: ${hack.playerMoveData[i]}`)
    }
    document.getElementById("someData").innerHTML = o.join('<br>')
  }

  document.body.insertAdjacentHTML("beforebegin", `
  <div id="controlPanel" style="display: inherit; width: auto; position: fixed; bottom: 0px; left: 0px; height: auto; text-align: left; font-size: 14px; background: rgb(0, 0, 0); color: rgb(255, 255, 255); opacity: 0.7; padding: 2px 2px;">
    <div>
      <span>new movement: </span>
      <button id="newMoveBtn" style="background: rgba(255, 255, 255, 0.7); color: black;">${hack.playerMoveData.newMovementIsOn}</button>
    </div>
  </div>
`)

  const updateButtonStates = () => {
    document.getElementById("newMoveBtn").innerText = hack.playerMoveData.newMovementIsOn
  }

  document.getElementById("newMoveBtn").addEventListener("click", () => {
    if (!hack.playerMoveData.newMovementIsOn) {
      newMovement()
    } else {
      oldMovement()
    }
    updateButtonStates()
  })

  setInterval(updateData, 100 / 6)
  updateButtonStates()
  setInterval(updateButtonStates, 100 / 6)
  hack.bindKeys()

  let scrActivate = function () {
    hack.getters.client.loopFunctions[2].timeOut = 100 / 6
    hack.getters.client.loopFunctions[3].timeOut = 0
    oldMovement()
    Object.defineProperty(hack.vars, 'mult', { enumerable: false })
    Object.defineProperty(hack.vars, 'lrSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'udSpd', { enumerable: false })
    Object.defineProperty(hack.vars, 'multSpdIsOn', { enumerable: false })
    Object.defineProperty(hack.vars, 'ghost1', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastHorizontalDirection', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'lastDashTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashDuration', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'dashEndTime', { enumerable: false })
    Object.defineProperty(hack.playerMoveData, 'newMovementIsOn', { enumerable: false })
    document.getElementById('timer').style.opacity = 0.7
    document.getElementById('timer').style.background = 'rgb(0, 0, 0)'
    document.getElementById('timer').style.color = 'rgb(255, 255, 255)'
    document.getElementById('seekerDistance').style.opacity = 0.7
    document.getElementById('seekerDistance').style.background = 'rgb(0, 0, 0)'
    document.getElementById('seekerDistance').style.color = 'rgb(255, 255, 255)'
    document.getElementById('hidersCount').style.color = 'rgb(255, 255, 255)'
    document.getElementById('hidersCount').style.opacity = 0.7
  }

setTimeout(() => {if (hack.vars.modeIsOn) {hack.functions.godModeEnable()}},300)

  hack.getters.client.findUntilFound = function (e, t, n) {
    hack.getters.network.gsip = e;
    hack.getters.network.gsrn = t;
    hack.getters.network.getSID?.((sid) => {
      hack.getters.network.sid = sid;
      hack.getters.network.connectToGs?.(hack.getters.network.gsip, () => {
        console.log("connected to gs");

        hack.getters.client.verifyIsHuman?.(() => {
          hack.getters.network.registerSidOnGs?.((verifyStatus) => {
            console.log("verified on gs server", verifyStatus);

            if (verifyStatus === "") {
              alert("You are already playing the game in another browser tab.");
              location.reload();
              n(2);
            } else {
              hack.getters.network.joinRoom?.(hack.getters.network.gsrn, (joinStatus) => {
                if (joinStatus === 1) {
                  hack.getters.client.sendPlayingInfo?.(hack.getters.client.roomId, () => {
                    hack.getters.client.onReady?.();
                    n(1);
                    scrActivate()
                  });
                } else {
                  console.log("else");
                  hack.getters.network.gsSockehack?.getters.client.disconnect?.();

                  do {
                    hack.getters.client.rIndex++;
                    const currentDataCenter = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex];

                    if (!currentDataCenter?.[hack.getters.client.rIndex]) {
                      hack.getters.client.dcIndex++;
                      hack.getters.client.rIndex = 0;

                      if (!hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]) {
                        alert("It seems all servers are full. Please refresh your page and try again.");
                        location.reload();
                        return;
                      }
                    }
                  } while (hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[2] !== hack.getters.client.modeInfo.mp);

                  const newGsip = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[1];
                  const newGsrn = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[3];
                  hack.getters.client.roomId = hack.getters.network.dataCenters?.[hack.getters.client.dcIndex]?.[hack.getters.client.rIndex]?.[4];

                  hack.getters.client.findUntilFound(newGsip, newGsrn, n);
                }
              });
            }
          });
        });
      });
    });
  };

  document.body.onkeydown = (event) => {
    const keyCode = event.keyCode
    switch (keyCode) {
      case 17:
        hack.getters.mode.makeMeGhost()
        break
      case 113:
        if (!hack.vars.modeIsOn) {
          hack.functions.godModeEnable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdEnable()
        } else {
          hack.functions.godModeDisable()
          hack.logFuncs.logModeIsOn()
          hack.functions.multSpdDisable()
        }
        break
      case 192:
      case 190:
        if (hack.vars.modeIsOn) {
          hack.suppFuncs.setMult()
          hack.logFuncs.logSpd()
        }
        break
    }
  }

  function isGrounded() {
    const meX = hack.getters.me.getX()
    const meY = hack.getters.me.getY()
    const ray = hack.getters.ray
    const physics = hack.getters.physics
    const gpPWorld = hack.getters.gp.pWorld
    const rayResult = hack.getters.me.ray.result
    const rayHitPoint = (hack.getters.ray.hitPoint = [Infinity, Infinity])

    const verticalOffset = 50
    const checkYPosition = meY + 45

    for (let i = 0; i < 121; i++) {
      const o = meX - 15 + i * (30 / 120)
      const s = checkYPosition
      const u = s + verticalOffset

      ray.from = [physics.xAxis(o, 0), physics.yAxis(s, 0)]
      ray.to = [physics.xAxis(o, 0), physics.yAxis(u, 0)]

      ray.update()
      rayResult.reset()

      if (gpPWorld.raycast(rayResult, ray)) {
        rayResult.getHitPoint(rayHitPoint, ray)
        const hitDistance = rayResult.getHitDistance(ray)

        if (rayResult.shape.ref.getCollision() && hitDistance < 0.1) {
          return true
        }
      }
    }

    return false
  }

  function newMovement() {
    hack.getters.client.loopFunctions[2].fun = function () {
      const currentTime = Date.now()
      const dashCooldown = 250
      const dashDistance = 2.5
      const dashSpeed = 25
      const grounded = isGrounded()

      if (grounded) {
        hack.playerMoveData.airDashAvailable = true
      }

      if (hack.getters.mode.moveLeft) {
        hack.playerMoveData.lastHorizontalDirection = -1
      } else if (hack.getters.mode.moveRight) {
        hack.playerMoveData.lastHorizontalDirection = 1
      }

      if (
        hack.keyBindings.isCPressed &&
        hack.getters.mode.moveDown &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashingDown &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashingDown = true
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (
        hack.keyBindings.isCPressed &&
        hack.getters.mode.moveUp &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashingUp &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashingUp = true
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (
        hack.keyBindings.isCPressed &&
        currentTime - hack.playerMoveData.lastDashTime >= dashCooldown &&
        !hack.playerMoveData.isDashing &&
        (grounded || (!grounded && hack.playerMoveData.airDashAvailable))
      ) {
        hack.playerMoveData.lastDashTime = currentTime
        hack.playerMoveData.isDashing = true
        hack.playerMoveData.dashVelocity = dashSpeed * hack.playerMoveData.lastHorizontalDirection
        hack.playerMoveData.dashDuration = (dashDistance / dashSpeed) * 1000
        hack.playerMoveData.dashEndTime = currentTime + hack.playerMoveData.dashDuration
        if (!grounded) {
          hack.playerMoveData.airDashAvailable = false
        }
      }

      if (hack.playerMoveData.isDashingDown) {
        hack.getters.mode.player.gpData.p.velocity[1] = -dashSpeed
        hack.getters.mode.player.gpData.p.velocity[0] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashingDown = false
          hack.getters.mode.player.gpData.p.velocity[1] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      }

      if (hack.playerMoveData.isDashingUp) {
        hack.getters.mode.player.gpData.p.velocity[1] = dashSpeed
        hack.getters.mode.player.gpData.p.velocity[0] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashingUp = false
          hack.getters.mode.player.gpData.p.velocity[1] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      }

      if (hack.playerMoveData.isDashing) {
        hack.getters.mode.player.gpData.p.velocity[0] = hack.playerMoveData.dashVelocity
        hack.getters.mode.player.gpData.p.velocity[1] = 0
        hack.getters.me.p.collisionResponse = false
        if (currentTime >= hack.playerMoveData.dashEndTime) {
          hack.playerMoveData.isDashing = false
          hack.getters.mode.player.gpData.p.velocity[0] = 0
          if (!hack.vars.modeIsOn) {
            hack.getters.me.p.collisionResponse = true
          }
        }
        return
      } else {
        if (hack.getters.mode.moveRight) {
          hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
        } else if (hack.getters.mode.moveLeft) {
          hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
        }
      }

      if (grounded) {
        hack.playerMoveData.isDoubleJumpAllowed = true
        if (hack.keyBindings.isZPressed) {
          hack.keyBindings.isZPressed = false
          hack.getters.velocity[1] = 8 * (hack.getters.me.p.gravityScale)
        }
      } else if (hack.playerMoveData.isDoubleJumpAllowed && hack.keyBindings.isZPressed) {
        hack.keyBindings.isZPressed = false
        hack.getters.velocity[1] = 8 * (hack.getters.me.p.gravityScale)
        hack.playerMoveData.isDoubleJumpAllowed = false
      }

      if (hack.vars.ghost1) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
        }
        if (hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
        }
        if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = 0
        }
      }
    }
    hack.playerMoveData.newMovementIsOn = true
  }

  function oldMovement() {
    hack.getters.client.loopFunctions[2].fun = function () {
      const grounded = isGrounded()

      if (hack.getters.mode.moveRight) {
        hack.getters.mode.player.gpData.p.velocity[0] = hack.vars.lrSpd * hack.vars.mult
      } else if (hack.getters.mode.moveLeft) {
        hack.getters.mode.player.gpData.p.velocity[0] = -hack.vars.lrSpd * hack.vars.mult
      }
      if (grounded) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = 8
        }
      }
      if (hack.vars.ghost1) {
        if (hack.getters.mode.moveUp) {
          hack.getters.velocity[1] = hack.vars.udSpd * hack.vars.mult
        }
        if (hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = -hack.vars.udSpd * hack.vars.mult
        }
        if (!hack.getters.mode.moveUp && !hack.getters.mode.moveDown) {
          hack.getters.velocity[1] = 0
        }
      }
    }
    hack.playerMoveData.newMovementIsOn = false
  }
addEventListener("mousewheel", e => {
    window.tweenObjects.map(x => {
        try {
            if (e.shiftKey) {
                hack.getters.mode.player.gpData.p.velocity[0] = -Math.sign(e.deltaY) * 15;
            } else {
                hack.getters.mode.player.gpData.p.velocity[1] = -Math.sign(e.deltaY) * 15;
            }
        } catch (err) {
            console.error(err);
        }
    });
})
}

let temp1 = {};
const _call = Function.prototype.call;
new Promise((resolve, reject) => {
  Function.prototype.call = function (...args) {
    if (args[2]?.exports) {
      temp1 = args[6]
      Function.prototype.call = _call
      console.log(temp1)
      resolve(temp1)
    }
    return _call.apply(this, args)
  };
}).then((result) => {
  if (Object.keys(result).length > 0) {
    activateMain(result)
  } else {
    console.log("temp1 is empty")
  }
}).catch((error) => {
  console.error("An error occurred:", error)
})
}

if (window.location.href == 'https://brofist.io/modes/sandbox/c/index.html') {
  sandboxHack();
} else if (window.location.href == 'https://brofist.io/modes/twoPlayer/c/index.html') {
  twoPlayerHack();
} else if (window.location.href == 'https://brofist.io/modes/hideAndSeek/c/index.html') {
  hideAndSeekHack();
}