onEvent('recipes', e=>{
    e.smelting(`allthemodium:unobtainium_allthemodium_alloy_ingot`,`allthemodium:unobtainium_allthemodium_alloy_dust`)
    e.smelting(`allthemodium:unobtainium_vibranium_alloy_ingot`,`allthemodium:unobtainium_vibranium_alloy_dust`)
    e.smelting(`allthemodium:vibranium_allthemodium_alloy_ingot`,`allthemodium:vibranium_allthemodium_alloy_dust`)
    //mekanism
const maq = [
    'energized_smelter',
    'enrichment_chamber',
    'crusher',
    'precision_sawmill',
    'osmium_compressor',
    'combiner',
    'purification_chamber',
    'chemical_injection_chamber',
    'metallurgic_infuser'

]

function upb(result,item){
    e.smithing(`mekanism:basic_${result}_factory`, `mekanism:${item}`,`mekanism:basic_tier_installer`)
}
        upb('smelting', 'energized_smelter')
        upb('enriching','enrichment_chamber')
        upb('crushing','crusher')
        upb('sawing','precision_sawmill')
        upb('compressing','osmium_compressor')
        upb('combining','combiner')
        upb('purifying','purification_chamber')
        upb('injecting','chemical_injection_chamber',)
        upb('infusing','metallurgic_infuser')

function upa(result){
    e.smithing(`mekanism:advanced_${result}_factory`,`mekanism:basic_${result}_factory`,'mekanism:advanced_tier_installer')}
         upa('smelting')
        upa('enriching')
        upa('crushing')
        upa('sawing')
        upa('compressing')
        upa('combining')
        upa('purifying')
        upa('injecting')
        upa('infusing')

function upe(result){
    e.smithing(`mekanism:elite_${result}_factory`,`mekanism:advanced_${result}_factory`,'mekanism:elite_tier_installer')}
        upe('smelting')
        upe('enriching')
        upe('crushing')
        upe('sawing')
        upe('compressing')
        upe('combining')
        upe('purifying')
        upe('injecting')
        upe('infusing')

function upu(result){
    e.smithing(`mekanism:ultimate_${result}_factory`,`mekanism:elite_${result}_factory`,'mekanism:ultimate_tier_installer')}
        upu('smelting')
        upu('enriching')
        upu('crushing')
        upu('sawing')
        upu('compressing')
        upu('combining')
        upu('purifying')
        upu('injecting')
        upu('infusing')



function mekanismr(mod,S){
    e.shaped(`${mod}`,[`RCR`, `FSF`, `RCR`],{R: `minecraft:redstone`, C: `mekanism:basic_control_circuit`, S: `${S}`, F: `mekanism:steel_casing`})
}
    e.shaped('mekanism:metallurgic_infuser', ['SFS', 'ROR', 'SFS'],{ S: '#forge:ingots/steel', F: 'ironfurnaces:iron_furnace', R: 'minecraft:redstone', O: 'mekanism:steel_casing'})
    e.shaped('mekanism:precision_sawmill', ['scs', 'ama', 'scs'],{s: '#forge:ingots/steel', c: 'mekanism:basic_control_circuit', a: 'mekanism:alloy_infused', m: 'thermal:machine_sawmill'})
    e.custom({
        type:'createMechanicalCrafting:shaped_table',
        pattern:['BSCSB', 'SATAS', 'STRTS', 'VLELV', 'BSCSB'],
        key:{
            B:'#forge:storage_blocks/steel',
            S: '#forge:ingots/steel',
            C: 'allthemodium:allthemodium_ingot',
            A: 'mekanism:alloy_atomic',
            T: 'mekanism:teleportation_core',
            R: 'mekanism:robit',
            V: 'mekanism:basic_control_circuit',
            L: 'mekanism:logistical_sorter',
            E: 'mekanism:basic_energy_cube',

        },
        result:{
            item: 'mekanism:digital_miner'
        }
    })

    mekanismr('mekanism:energized_smelter', 'thermal:machine_furnace')
    mekanismr('mekanism:enrichment_chamber', 'thermal:machine_pulverizer')
    mekanismr('mekanism:crusher', 'create:mechanical_press')

    e.recipes.mekanismMetallurgicInfusing('mekanism:alloy_atomic', 'mekanism:alloy_reinforced', 'minecraft:redstone', 20)

    e.shaped(`mekanism:basic_tier_installer`,['rbr', 'isi', 'rbr'],{r: 'minecraft:redstone', b: 'mekanism:basic_control_circuit', i: '#forge:ingots/iron', s: '#forge:gears/steel'})
    e.shaped(`mekanism:advanced_tier_installer`,['iai', 'ouo', 'iai'],{i: 'mekanism:alloy_infused', a: 'mekanism:advanced_control_circuit', o: '#forge:ingots/osmium', u: 'thermal:upgrade_augment_1'})
    e.shaped(`mekanism:elite_tier_installer`,['rcr', 'gtg', 'rcr'],{r: 'mekanism:alloy_reinforced', c: 'mekanism:elite_control_circuit', g: '#forge:ingots/gold', t: 'thermal:upgrade_augment_2' })
    e.shaped(`mekanism:ultimate_tier_installer`,['uau', 'dtd', 'uau'],{u: 'mekanism:alloy_atomic', a: 'mekanism:ultimate_control_circuit', d: 'minecraft:diamond', t: 'thermal:upgrade_augment_3'})
    function upg(result,meio){
        e.shaped(`mekanism:upgrade_${result}`,[' b ', 'aia', ' p '],{b: 'mekanism:basic_control_circuit', a: 'mekanism:alloy_infused', i: `${meio}`, p: `industrialforegoing:plastic`})
        e.remove({output: `mekanism:upgrade_${result}`})
    }
    upg('speed', '#forge:sugar/sugar')
    upg('energy', 'thermal:machine_efficiency_augment')
    upg('filter', 'pipez:filter_destination_tool')
    upg('gas', 'mekanism:basic_chemical_tank')
    upg('anchor', 'darkutils:anchor_plate')
    for(let pos in dust){
    e.recipes.mekanismCrushing(`#forge:dusts/${dust[pos]}`, `#forge:ingots/${dust[pos]}`)}
    e.recipes.mekanismCrushing(`emendatusenigmatica:bronze_ingot`, `emendatusenigmatica:bronze_dust`)

    //refined'mekanism:basic__factory'
function storageRefined(qnt, a,c,d){
    e.shaped(`refinedstorage:${qnt}k_storage_part`, [`aba`, `cdc`, `aca`], {a: `${a}`, b: 'refinedstorage:quartz_enriched_iron', c: `${c}`, d: `${d}`})
    e.remove({output: `refinedstorage:${qnt}k_storage_part`})}

    storageRefined('1', 'refinedstorage:silicon', '#forge:glass', 'appliedenergistics2:logic_processor');
    storageRefined('4', 'refinedstorage:basic_processor', 'refinedstorage:1k_storage_part', 'appliedenergistics2:calculation_processor');
    storageRefined('16', 'refinedstorage:improved_processor', 'refinedstorage:4k_storage_part', 'appliedenergistics2:calculation_processor');
    storageRefined('64', 'refinedstorage:advanced_processor', 'refinedstorage:16k_storage_part', 'appliedenergistics2:calculation_processor');
    e.shaped('refinedstorage:controller',['qaq', 'pcp', 'qpq'],{q: 'refinedstorage:quartz_enriched_iron', a: 'appliedenergistics2:engineering_processor', p: 'refinedstorage:advanced_processor', c: 'refinedstorage:machine_casing'});
    e.shaped('refinedstorage:disk_drive',['ici', 'aca', 'ipi'],{i: 'refinedstorage:quartz_enriched_iron', c: '#forge:chests', a: 'appliedenergistics2:engineering_processor', p: 'refinedstorage:advanced_processor'});


    //thermal
   
    e.shaped(`thermal:upgrade_augment_1`,['pgp', 'rgr', 'pgp'],{p: '#forge:plates/invar', g: '#forge:glass', r: 'minecraft:redstone', g: 'mekanism:alloy_infused'})
    e.shaped(`thermal:upgrade_augment_2`,['eqe', 'sis', 'eqe'],{e: '#forge:plates/electrum', q: 'minecraft:quartz', s: '#forge:gears/signalum', i:`thermal:upgrade_augment_1`})
    e.shaped(`thermal:upgrade_augment_3`,['ege', 'rlr', 'ege'],{e: '#forge:plates/enderium', g: '#forge:glass', r: '#forge:gears/electrum', l: `thermal:upgrade_augment_2`})

    //addcreate

     e.recipes.createMixing(`4x emendatusenigmatica:brass_dust`, [`3x #forge:dusts/copper`, `#forge:dusts/zinc`])
     e.recipes.createMixing(`2x emendatusenigmatica:constantan_dust`, [`#forge:dusts/copper`, `#forge:dusts/nickel`])
     e.recipes.createMixing(`2x emendatusenigmatica:electrum_dust`, [`#forge:dusts/gold`, `#forge:dusts/silver`])
     e.recipes.createMixing(`3x emendatusenigmatica:invar_dust`, [`2x #forge:dusts/iron`, `#forge:dusts/nickel`])
     e.recipes.createMixing(`4x emendatusenigmatica:signalum_dust`, [`3x #forge:dusts/copper`, `#forge:dusts/silver`, `4x minecraft:redstone`])
     e.recipes.createMixing(`4x emendatusenigmatica:lumium_dust`, [`3x #forge:dusts/tin`, `#forge:dusts/silver`, `2x minecraft:glowstone_dust`])
     e.recipes.createMixing(`2x emendatusenigmatica:enderium_dust`, [`3x #forge:dusts/lead`, `#forge:dusts/diamond`, `2x #forge:dusts/ender_pearl`])
     e.recipes.createMixing(`4x emendatusenigmatica:bronze_dust`, [`3x #forge:dusts/copper`, `#forge:dusts/tin`])
     e.recipes.createMixing(`allthemodium:unobtainium_allthemodium_alloy_dust`,[`allthemodium:unobtainium_dust`,`allthemodium:allthemodium_dust`]).superheated()
     e.recipes.createMixing(`allthemodium:unobtainium_vibranium_alloy_dust`,[`allthemodium:vibranium_dust`,`allthemodium:unobtainium_dust`]).superheated()
     e.recipes.createMixing(`allthemodium:vibranium_allthemodium_alloy_dust`,[`allthemodium:vibranium_dust`,`allthemodium:allthemodium_dust`]).superheated()



    //fluxpoint
    e.shaped(`fluxnetworks:flux_point`,['efe', 'frf', 'efe'],{e: `minecraft:ender_pearl`, f: `fluxnetworks:flux_core`, r: `minecraft:redstone_block`})


    //xnet

    function xnet(cor){
        e.shaped(`xnet:advanced_connector_${cor}`,[' l ', 'rcr', ' e '],{l: `mekanism:logistical_sorter`, r: `minecraft:redstone`, c: `xnet:connector_${cor}`, e: `minecraft:ender_pearl`})
        e.remove({output: `xnet:advanced_connector_${cor}`})
            xnet('red')
            xnet('green')
            xnet('blue')
            xnet('yellow')
}
    function xnetC(cor){
        e.shaped(`8x xnet:netcable_${cor}`,['aca', 'rbr', 'ara'],{a: `mekanism:alloy_infused`, c: `minecraft:${cor}_dye`, r: `minecraft:redstone`, b: `mekanism:basic_control_circuit`})
        e.remove({output: `xnet:netcable_${cor}`})}
            xnetC('red')
            xnetC('green')
            xnetC('blue')
            xnetC('yellow')

    function cxnet(cor){
        e.shaped(`xnet:connector_${cor}`, ['clc', 'aea', 'cac'],{c: `minecraft:${cor}_dye`, l: 'pipez:universal_pipe', a: `mekanism:alloy_infused`, e: `mekanism:elite_control_circuit`})
        e.remove({output: `xnet:connector_${cor}`})}
            cxnet('red')
            cxnet('green')
            cxnet('blue')
            cxnet('yellow')

    function xnet(cor){
        e.shaped(`xnet:advanced_connector_${cor}`,[' l ', 'rcr', ' e '],{l: `mekanism:logistical_sorter`, r: `minecraft:redstone`, c: `xnet:connector_${cor}`, e: `minecraft:ender_pearl`})
        e.remove({output: `xnet:advanced_connector_${cor}`}) }
            xnet('red')
            xnet('green')
            xnet('blue')
            xnet('yellow')
   


        e.shaped(`xnet:connector_routing`, ['rrr', 'aca', 'rrr'],{r: `mekanism:alloy_infused`, a: `mekanism:basic_control_circuit`, c: `#xnet:connectores`})
        e.remove({output: `xnet:connector_routing`})
        e.shaped(`16x xnet:netcable_routing`,['aca', 'rbr', 'ara'],{a: `mekanism:alloy_infused`, c: `minecraft:black_dye`, r: `minecraft:redstone`, b: `mekanism:basic_control_circuit`})            
        e.remove({output: `xnet:netcable_routing`})
        e.shaped(`xnet:advanced_connector_routing`,[' l ', 'rcr', ' e '],{l: `mekanism:logistical_sorter`, r: `minecraft:redstone`, c: `xnet:connector_routing`, e: `minecraft:ender_pearl`})
        e.remove({output: `xnet:advanced_connector_routing`})

        e.shaped(`xnet:facade`,['ala', 'lgl', 'ala'],{a: 'framedblocks:framed_inner_threeway_corner', l: `#forge:wool`, g: `#forge:glass`})
        e.remove({output: `xnet:facade`})


    //industrial
    e.shaped(`industrialforegoing:fluid_extractor`,['ftf', 'cpc', 'fmf'],{f: `#forge:ingots/iron`, t: `thermal:saw_blade`, c: `#forge:cobblestone`, m: `mekanism:basic_fluid_tank`})
    e.shaped(`industrialforegoing:machine_frame_pity`,['msm', 'srs', 'msm'],{m: `#minecraft:logs`, s: `#forge:ingots/steel`, r: `minecraft:redstone_block`})
    e.shaped(`industrialforegoing:mob_crusher`,['pmp', 'bfb', 'gcg'],{p: `industrialforegoing:plastic`,m: 'mob_grinding_utils:saw', b: 'minecraft:book', f: 'industrialforegoing:machine_frame_advanced', g: '#forge:gears/diamond', c: '#forge:chests'})


}) 