colors = colors or {} ingredients = { ['Water Bottle'] = colors.white, ['Nether Wart'] = colors.orange, ['Glowstone Dust'] = colors.magenta, ['Redstone'] = colors.lightBlue, ['Fermented Spider Eye'] = colors.yellow, ['Magma Cream'] = colors.lime, ['Sugar'] = colors.pink, ['Glistering Melon'] = colors.gray, ['Spider Eye'] = colors.cyan, ['Ghast Tear'] = colors.purple, ['Blaze Powder'] = colors.blue, ['Golden Carrot'] = colors.brown, ['Gunpowder'] = colors.green } recipes = { ['Awkward Potion'] = { 'Water Bottle', 'Nether Wart' }, ['Thick Potion'] = { 'Water Bottle', 'Glowstone Dust' }, ['Speed Potion'] = { 'Awkard Potion', 'Sugar' } } function valueInTable(t, v) for key, value in pairs(t) do if value == v then return true end end return false end function isBasicIngredient(s) if ingredients[k] then return true else return false end end function getWaterBottles(n) for i = 1, n do rs.setBundledOutput('right', ingredients['Water Bottle']) sleep(0.2) rs.setBundledOutput('right', 0) sleep(0.2) end end function brewPotion(potion, amount) amount = amount or 3 for i = 1, #recipes[potion] do ingredient = recipes[potion][i] print(ingredient) if isBasicIngredient(ingredient) and ingredient ~= 'Water Bottle' then rs.setBundledOutput('right', ingredients[ingredient]) sleep(0.2) rs.setBundledOutput('right', 0) sleep(25) elseif ingredient == 'Water Bottle' then getWaterBottles(amount) else brewPotion(ingredient, amount) end end end brewPotion('Speed Potion')