Ammo Mod | Shell Shockers | flygOn LiTe

Ammo Mod by flygOn LiTe

目前为 2023-05-04 提交的版本。查看 最新版本

// ==UserScript==
// @name        Ammo Mod | Shell Shockers | flygOn LiTe
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Ammo Mod by flygOn LiTe
// @author       flygOn LiTe
// @match        https://shellshock.io/*
// @match        https://mathactivity.xyz/*
// @match        https://mathdrills.life/*
// @icon         https://www.berrywidgets.com/assets/health-bar2.png
// @grant        none
// @license MIT
// ==/UserScript==
(function() {
  'use strict';

  function injectScriptAndStyles() {
    const scriptContent = `(${main.toString()})();`;
    const scriptElement = document.createElement("script");
    scriptElement.textContent = scriptContent;
    document.body.appendChild(scriptElement);

    const styleContent = `
      @keyframes shift-color {
  0% {
    background-position: left;
  }
  100% {
    background-position: right;
  }
}
.goal-container {
  width: 265px;
  height: 38px;
  border: 3px solid#bc5810;
  border-radius: 12px;
  position: relative;
  margin: 8px 0;
  padding: 2px;
  background: #bc5810;
  z-index: 0;
}
.goal-bar {
  overflow: hidden;
  transition: 750ms width;
  background-image: linear-gradient(
    90deg,
    rgba(105, 6, 255, 1) 0%,
    rgba(0, 252, 228, 1) 100%
  );
  background-size: 400%;
  animation: shift-color 3s infinite alternate;
  height: 100%;
  border-radius: 12px;
  z-index: 1;
}
#weaponBox {
  position: absolute;
  right: 42% !important;
  bottom: 12% !important;
  text-align: center !important;
  z-index: 9 !important;
  background-image: url("https://www.berrybroscrypto.com/images/healthbar-animation.gif") !important;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
#ammo {
  position: relative;
  color: #d4a537 !important;
  font-size: 0.9em !important;
  font-family: snicker, sans-serif !important;
  font-weight: 700;
  transform: translateY(40px) !important;
  font-style: normal;
  font-weight: bold;
  background-image: none !important;
  text-align: center !important;
  z-index: 10 !important;
}
#grenades {
  padding-bottom: 0px;
  margin-bottom: 0;
  transform: translateY(20px) !important;
}

#grenades img {
  width: 50px !important;
  height: 50px !important;
}
    `;
    const styleElement = document.createElement("style");
    styleElement.textContent = styleContent;
    document.head.appendChild(styleElement);
  }

  function main() {
    //DEVELOPED AND MAINTAINED BY FLYGON LITE
//THIS CODE IS NOT OBFUSCATED, PLEASE DO NOT REPORT, THANK YOU ENJOY :)
//FOR QUESTIONS OR BUG FIXES CONTACT ON DISCORD- LiTe#1241

//Set ammo based on weapon class
let ammoTotal;
function setAmmoAmount() {
  let playerClass = vueData.classIdx;
  switch (playerClass) {
    case (playerClass = 0):
      ammoTotal = 240;
      break;
    case (playerClass = 1):
      ammoTotal = 24;
      break;
    case (playerClass = 2):
      ammoTotal = 60;
      break;
    case (playerClass = 3):
      ammoTotal = 3;
      break;
    case (playerClass = 4):
      ammoTotal = 200;
      break;
    case (playerClass = 5):
      ammoTotal = 20;
      break;
    case (playerClass = 6):
      ammoTotal = 150;
      break;
    default:
      ammoTotal = 60;
  }
  return playerClass;
}

//Check weapon class
function bathroomCheck(daiperButt) {
  wipeButt = setInterval(repeatcheck, 500, daiperButt);
  function repeatcheck(daiperButt) {
    if (daiperButt === true) {
      setAmmoAmount();
    } else {
      clearInterval(wipeButt);
    }
  }
}
bathroomCheck(vueData.isPaused);

//Selectors
let honeyBucket = document.querySelector("#weaponBox");
let explosiveDiarrhea = document.querySelector("#ammo");

//Create bar
let goalContainer = document.createElement("div");
goalContainer.classList.add("goal-container");
honeyBucket.appendChild(goalContainer);
let goalFill = document.createElement("div");
goalFill.classList.add("goal-bar");
goalContainer.appendChild(goalFill);

//Watch ammo and do stuff
var observeAmmo = new MutationObserver((mutations) => {
  mutations.forEach((record) => {
    if (
      record.addedNodes.length === 1 &&
      record.addedNodes[0].nodeType === Node.TEXT_NODE &&
      record.removedNodes.length === 1 &&
      record.removedNodes[0].nodeType === Node.TEXT_NODE
    ) {
      let getAmmoStr = record.addedNodes[0].nodeValue;
      let modifiedAmmoStr = getAmmoStr.substring(
        getAmmoStr.lastIndexOf("/") + 1
      );
      let ammoPercentage = (Number(modifiedAmmoStr) / ammoTotal) * 100;
      goalFill.style.setProperty("width", ammoPercentage + "%");
    }
  });
});
observeAmmo.observe(explosiveDiarrhea, {
  childList: true,
});

    // Wrap the event listener attachment in a separate function
    function attachEventListener() {
      const equippedSlots = document.getElementById("equip_equippedslots");
      if (equippedSlots) {
        equippedSlots.addEventListener("DOMSubtreeModified", function () {
          bathroomCheck(vueData.isPaused);
        });
      } else {
        setTimeout(attachEventListener, 100);
      }
    }

    // Call the function to attach the event listener
    attachEventListener();
  }

  // Check if the necessary DOM elements are available
  function checkDOMElements() {
    const weaponBox = document.querySelector("#weaponBox");
    const ammoElement = document.querySelector("#ammo");
    return weaponBox !== null && ammoElement !== null;
  }

  // Wait for the necessary DOM elements to be loaded before injecting the script and styles
  function waitForDOMElements() {
    if (checkDOMElements()) {
      injectScriptAndStyles();
    } else {
      setTimeout(waitForDOMElements, 100);
    }
  }

  waitForDOMElements();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址