Infinite Craft Userscript Official
// Update the recipe book UI function updateRecipeBook() if (!recipeListDiv) return; if (recipes.size === 0) recipeListDiv.innerHTML = '<div style="color:#888; padding:8px;">No recipes yet. Combine elements to learn!</div>'; return;
// Initial scan for already discovered elements document.querySelectorAll('.element').forEach(el => const name = el.textContent?.trim(); if (name) discovered.add(name); );
document.body.appendChild(panel);
toggleBtn.addEventListener('click', () => recipesPanel.style.display = recipesPanel.style.display === 'none' ? 'block' : 'none'; );
// Create UI panel const panel = document.createElement('div'); panel.id = 'ic-enhanced-panel'; panel.style.cssText = ` position: fixed; bottom: 20px; right: 20px; width: 320px; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); border-radius: 12px; padding: 12px; color: white; font-family: system-ui, sans-serif; z-index: 9999; border: 1px solid #444; font-size: 13px; max-height: 70vh; display: flex; flex-direction: column; `; infinite craft userscript
function sleep(ms) return new Promise(r => setTimeout(r, ms));
// Auto-learn: repeatedly combine the newest discovered with everything async function autoLearn() autoLearnBtn.disabled = true; autoLearnBtn.textContent = '⏳ Learning...'; // Update the recipe book UI function updateRecipeBook()
// Alternative: observe DOM changes for new elements const observer = new MutationObserver(() => const elements = document.querySelectorAll('.element'); elements.forEach(el => const name = el.textContent?.trim(); if (name && !discovered.has(name)) discovered.add(name); ); updateRecipeBook(); ); observer.observe(document.body, childList: true, subtree: true );