// Manual recipe addition from user combining function addRecipeFromCombine(left, right, result) if (left && right && result) recipes.set(result, [left, right]); updateRecipeBook();
function escapeHtml(str) return str.replace(/[&<>]/g, function(m) if (m === '&') return '&'; if (m === '<') return '<'; if (m === '>') return '>'; return m; );
// 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; infinite craft userscript
autoLearnBtn.addEventListener('click', autoLearn);
let html = '<table style="width:100%; border-collapse: collapse;">'; for (let [result, [left, right]] of recipes.entries()) html += ` <tr class="ic-recipe-row" data-left="$escapeHtml(left)" data-right="$escapeHtml(right)" style="border-bottom:1px solid #333; cursor:pointer;"> <td style="padding:6px 4px;">$escapeHtml(left)</td> <td style="padding:6px 4px;">+</td> <td style="padding:6px 4px;">$escapeHtml(right)</td> <td style="padding:6px 4px; color:#4caf50;">→ $escapeHtml(result)</td> </tr> `; html += '</table>'; recipeListDiv.innerHTML = html; // Manual recipe addition from user combining function
// Auto-fill the two slots and craft function autoCraft(leftName, rightName) const leftInput = document.querySelector('.left-element-input, input[placeholder*="left"], input[placeholder*="element"]:first-of-type'); const rightInput = document.querySelector('.right-element-input, input[placeholder*="right"], input[placeholder*="element"]:last-of-type'); const craftBtn = document.querySelector('.craft-button, button:contains("Craft"), button[aria-label="Craft"]');
(function() 'use strict';
if (!leftInput