Infinite Craft auto maker

Very fast automatic item explorer for infinite craft

当前为 2024-03-02 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Infinite Craft auto maker
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Very fast automatic item explorer for infinite craft
// @author       Aetherium
// @match        https://neal.fun/infinite-craft/
// @icon         https://cdn.discordapp.com/attachments/1149405048049254521/1213453447312179250/Leaf-PlexusBot.jpg?ex=65f58796&is=65e31296&hm=9429f9b475e4c8240d555afd1626549b179d6689dff76bd343d67de9898fe102&
// @grant        none
// @license      MIT
// ==/UserScript==

// This whole script will launch on startup

let totalElements = 0;
let currentElement = 0;
let nextElement = 0;
let mobileItems;

function updateElements() {
    mobileItems = document.querySelectorAll('.mobile-item');
    if (mobileItems.length >= 2) {
        totalElements = mobileItems.length;
        currentElement = getRandomElementIndex(totalElements);
        nextElement = getRandomElementIndex(totalElements);
        while (nextElement === currentElement) {
            nextElement = getRandomElementIndex(totalElements);
        }
        if (mobileElementInRange(currentElement)) {
            mobileItems[currentElement].querySelector('.item').click();
        }
        if (mobileItems) {
            mobileItems[nextElement].querySelector('.item').click();
        }
    }
    document.title = `${currentElement}+${nextElement}|${totalElements}`;
}

function mobileElementInRange(index) {
    return index >= 0 && index < totalElements;
}

function getRandomElementIndex(max) {
    return Math.floor(Math.random() * max);
}

function animate() {
    updateElements();
    setTimeout(animate, 200); // Change this to 200 for not rate limited
}

animate();