#Variable Help

16 messages · Page 1 of 1 (latest)

ruby bramble
#

i started making crete sequenced recipes using kubeJS and i am using variables inside the seqence so the code is more readable

bold carbonBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

ruby bramble
#

and i whant to have the variable inter for all of the recipes

#
ServerEvents.recipes(e => {
    let inter = 'kubejs:incomplete_calculation_processor'
    e.recipes.create.sequenced_assembly(
        ['ae2:printed_calculation_processor'],'ae2:certus_quartz_crystal',[
            e.recipes.createFilling(inter, [inter, Fluid.lava(100)]),
            e.recipes.createDeploying(inter , [inter,'ae2:calculation_processor_press']).keepHeldItem(),
            e.recipes.createPressing(inter , inter)
        ]).transitionalItem(inter).loops(1)
    let inter = 'kubejs:incomplete_calculation_processor'
    e.recipes.create.sequenced_assembly(
        ['ae2:printed_calculation_processor'],'ae2:certus_quartz_crystal',[
            e.recipes.createFilling(inter, [inter, Fluid.lava(100)]),
            e.recipes.createDeploying(inter , [inter,'ae2:calculation_processor_press']).keepHeldItem(),
            e.recipes.createPressing(inter , inter)
        ]).transitionalItem(inter).loops(1)
})
#

i whant to reuse the variable inter for all of the recipes

#

and i get an error because i cant redefine that variable

#

is there a way to have inter a variable for some lines of code not the whole document

#

or do i need to have a different variable for eatch recipe?

nova heath
#

remove the second let inter

you already defined it

ruby bramble
#

i whant to redefine it

#

because i whant to have a different tranzitional item for every recipe

nova heath
#

so remove let

#

inter = "minecraft:stone"

ruby bramble
#

0p'\

marble quartz
#

Most IDEs will higlight syntax errors...

#

Worth using something like VSCode or IntelliJ community.