Starblast iOS Drop Gems Button

Adds a button to drop gems (like pressing V)

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greatest.deepsurf.us/scripts/572397/1789757/Starblast%20iOS%20Drop%20Gems%20Button.js

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Starblast iOS Drop Gems Button
// @namespace    starblast-ios
// @version      1.0
// @description  Adds a button to drop gems (like pressing V)
// @match        https://starblast.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Create button
    const btn = document.createElement("div");
    btn.innerText = "💎 DROP";
    btn.style.position = "fixed";
    btn.style.left = "10px";
    btn.style.top = "50%";
    btn.style.transform = "translateY(-50%)";
    btn.style.background = "rgba(0,0,0,0.7)";
    btn.style.color = "white";
    btn.style.padding = "10px 15px";
    btn.style.borderRadius = "10px";
    btn.style.fontSize = "14px";
    btn.style.zIndex = "9999";
    btn.style.userSelect = "none";
    btn.style.touchAction = "manipulation";

    document.body.appendChild(btn);

    // Function to simulate "V" key press
    function dropGems() {
        const down = new KeyboardEvent("keydown", {
            key: "v",
            code: "KeyV",
            keyCode: 86,
            which: 86
        });

        const up = new KeyboardEvent("keyup", {
            key: "v",
            code: "KeyV",
            keyCode: 86,
            which: 86
        });

        document.dispatchEvent(down);
        document.dispatchEvent(up);
    }

    // Tap event (mobile)
    btn.addEventListener("touchstart", (e) => {
        e.preventDefault();
        dropGems();
    });

    // Click event (backup)
    btn.addEventListener("click", dropGems);

})();