#"External" Sequenced Assembly (a.k.a: External Sequencing)

115 messages · Page 1 of 1 (latest)

dire tide
#

Current Script Version: https://discordapp.com/channels/303440391124942858/1105939183261995120/1113598222884151296
On Github: https://github.com/anabsolutesloth/Empers-Maybe-Evil-Scripts/blob/main/kubejs/1-18/external_sequencing.js
Also Available via KJSPKG!

This accursed script allows you to not only add regular Sequenced Assembly recipes using Create, but also add steps using any recipe type that KJS can use.

Example recipes are included in the script to showcase its features, but commented out, you can add another / to the comment right after the description of the showcase to enable them.

It's the product of a lot of on-and-off work over many months, and it still has some features i want to implement (namely hiding External Steps automatically, so you don't need to clear up 50 JEI pages of External steps manually), but the core functionality is at a point where i'm happy with it.

i'll probably be uploading the file again to this post whenever it updates, might set up a github repository for this and some other useful/fun script projects at some point aswell, will probably link it here if and when i do.

I also plan to make a version retrofitted for 1.16.5, if this version isn't already compatible.

have fun making extremely cursed recipes :)

keen rivetBOT
#

Paste version of external_sequencing.js from @dire tide

dire tide
#

@iron storm @torpid plover @serene cairn
you've all used the External Sequencing script in the past, pinging you to notify that it's updated somewhat

torpid plover
#

alright, thanks!

dire tide
#

"External" Sequenced Assembly (a.k.a: External Sequencing)

inner thistle
#

Out of curiosity, what does this implementation do that KubeJS Create's Sequenced Assembly doesn't?

clever iron
viscid night
#

That is exactly what it does, having just played around a bit with the recipe that was given

#

This is really cool

clever iron
#

This script is a game changer, im about to have alot of fun with this

viscid night
#

Yeah same haha

whole maple
#

Not very good with programming, I struggle with the bare bones basic implementations of KJS to change my recipes, but if this does what I think it does I might need to change that.

Just to make sure I'm not misunderstanding here before going out of my way to learn enough to use this script; Any recipe type KJS can use means I could make the recipe include a (as examples) botania alfheim trade or runic altar recipe in the sequenced assembly?

viscid night
#

I believe so yeah, although having played around with it some interactions get a little finicky like having the crushing wheels be the first recipe in the sequence just doesn't work

eager shadow
#

Can I add it?

buoyant osprey
#

unrelated, but why is that an image link instead of a real emoji

eager shadow
#

I use bd instead

viscid night
# dire tide doesn't work how?

At least from my testing if the crushing wheels are the first step it just does the normal crushing wheel thing of destroying the item

#

Anywhere else it works so idk

inner thistle
dire tide
#

doesn't seem like it works as the first step for external, i wonder why

#
    addExtSequenceRecipe(['minecraft:coarse_dirt'], 'minecraft:dirt',
        [
            {
                'type': 'cut',
                'time': 50 
            },
            {
                'type': 'external',
                'dummy': 'create:crushing_wheel',
                'info': [
                    {
                        'text': 'Crush with Crushing Wheels',
                        'color': 'gold'
                    }
                ],
                'json_format': false,
                'recipedata': (post, pre, id) => event.recipes.createCrushing([post], pre).id(id)
            },
            {
                'type': 'press'
            }
        ],
    1, 'minecraft:terracotta', 'crushing_extseq_test', event)```
i made this to test it, and removing the cut step destroyed the item when put in the wheels
#

oh, this is odd, the logging is saying it put the transitional item with effectively empty data

#

seems like this may be a more universal issue beyond crushing

#

alright, well it is a surprisingly simple problem

#
                    //Check if current Step is the first, if it is, use the "Base" item as the Input of the step
                    if(sequenceStep != 0){```
the problem is, `sequenceStep` starts at a value of `1`, so `preItem` is never the `base` item
keen rivetBOT
#

Paste version of external_sequencing.js from @dire tide

viscid night
#

That works, thank you!

#

Oh btw, you don't mind if I use this script in my pack do you? Just want to make sure haha

serene cairn
#

That brings up a good question, is there any specific license the script is licensed under?

viscid night
#

Most likely not, but I'd like to make sure before I get yelled at xD

dire tide
#

as long as credit is given, you're all good

viscid night
#

Will do :)

nimble nexus
#

hi there I was trying to use this but I keep getting an error

[16:06:33] [INFO ] server_scripts:crushed glass.js:53: Beginning addition of Recipe 'empercog:sequencing/extsequence_test' with 6 Steps and 2 Loops. (total of 12 steps)
! [16:06:33] [ERR] #92: Error occurred while handling event 'ServerEvents.recipes': Java class "dev.latvian.mods.kubejs.bindings.UtilsWrapper" has no public instance field or method named "mapOf". (server_scripts:crushed glass.js#92)

am I doing something wrong ?

thorny aurora
#

This is beautiful

viscid night
nimble nexus
viscid night
#

There most likely is but I'm not savvy enough with how kjs works to know what to change. All I can tell is that it doesn't like the mapOf method

nimble nexus
fringe geode
#

Hey, quick question on your script @dire tide - I hope it's okay to @ you as the thread is pretty buried.

I'm using it and trying to add Create's Mixing as an external recipe. I have the bit where I call the mechanical mixer:
'recipedata': (post, pre, id) => event.recipes.createMixing(post, pre).id(id)

and so far, it requires the recipe to mix it. I'm unsure how to add items to the mixing recipe, though. I was looking at some of your older examples, and I found this script:
#997433465035313172 message

In it, you used mekanism. How did you figure out which recipedata you needed to use to get what you wanted? As in, how did you come up with the main line;
recipedata': () => event.recipes.mekanismMetallurgicInfusing(postItem, preItem, {'infuse_type': 'mekanism:redstone', 'amount': 100}).id(genID)

I've never used a script like this or done something this complex, so I apologize if it's an easy-to-answer question

keen rivetBOT
#

[Quote ➤](#997433465035313172 message) ```js
createSequencing(['mekanism:energy_tablet'], 'mekanism:enriched_gold',
[
{
'type': 'deploy',
'input': 'mekanism:basic_control_circuit'
},
{
'type': 'external',
'dummy': 'mekanism:metallurgic_infuser',
'info': ['|6Process item in this Machine!','|6Requires |c100 Redstone Infuse'],
'recipedata': () => event.recipes.mekanismMetallurgicInfusing(postItem, preItem, {'infuse_type': 'mekanism:redstone', 'amount': 100}).id(genID)
},
{
'type': 'deploy',
'input': 'createdeco:cast_iron_sheet'
},
{
'type': 'press'
}
],
1, 'empercog:midseq_energy_tablet', 'energy_tablet')

dire tide
#
'recipedata': (post, pre, id) => event.recipes.createMixing([post, 'minecraft:dirt'], [pre, 'minecraft:grass']).id(id)```
#

think of the post and pre as just another item in the recipe, cause that's all they really are :p just their sequenced assembly NBT is dynamic

#

recipedata is really just a function on a map variable, so that it can be called and then used after determining what the assembly NBT should be at that step.

fringe geode
dire tide
#

essentially, yes

#

you can also add the outputisarray element with a value of true on the final step to make it use the full output array fed into the function call

#

the script typically indexes 0 on the outputs field if it detects the current step is the absolute final one, last step of the last loop

#

you can add that element with true to make it not index 0 and just use the full array given

#
                    //Check if current Step is the last, if it is, use the first "Output" item as the Result of the step
                    if(estStep != totalSteps){
                        postItem = Item.of(transitional, `{SequencedAssembly:{Progress:${nextProgress},Step:${estStep},id:"${packID}:sequencing/${id}"}}`);
                    } else if(step.outputisarray){
                        //this is technically a useless feature, since you can achieve the same effect by defining other items in the final step's recipe, but it's nice for consolidating i guess?
                        postItem = outputs;
                    } else {
                        postItem = outputs[0];
                    }```
#

this is the code that handles what the output of an external step should be

fringe geode
#

Sorry if I'm not responding right away, just trying to understand everything 🙂 searching up a lot of definitions and all that

#

Thank you for the explanation though! It's really concise, and I'm sure it's possible to get it if I keep at it

dire tide
#

if you're a bit new to programming, that makes sense

fringe geode
#

The extent of my knowledge is a semester on javascript, so it's not much 🥲 but I'm taking some time this summer to try and learn some more

dire tide
#

well, i hope you have some fun messing with my incredibly cursed system :p

fringe geode
#

It's awesome! Thanks for making it, it's very cool

eager shadow
dire tide
#

i totally missed that before lol

#

go right ahead

eager shadow
#

alr

#

any license for the code?

dire tide
#

got caught up in the first step funky business, that's how

dire tide
eager shadow
dire tide
#

prolly GNU GPLv3

#

maybe i should get on a repository for all these script projects :p

eager shadow
#

at least from what I've heard

#

LGPL v3 is tho

dire tide
#

piss

#

well uh, LGPLv3 is probably fine i'd imagine? i'd have to give it a cursory look though, but i gotta go do something, so i'll have a look when i'm back

eager shadow
#

alr I'll put it under LGPL and add you to the repo so you can change it later if you want

#

what's your gh btw

dire tide
#

anabsolutesloth

dire tide
#

can write up some information on the example recipe(s) included in the script for the GH page if you'd like

#

but maybe that's not necessary

eager shadow
#

I’ll setup the package tomorrow

dire tide
#

version 1.1.2
adds support for .keepHeldItem() to deploying recipes with the new keepItem element in Deploying steps.
also adds extensive descriptions to the Example Recipes of what is going on in them.
and i realized that outputisarray is actually a useful feature, because of multiple loop recipes.

keen rivetBOT
#

Paste version of external_sequencing.js from @dire tide

dire tide
eager shadow
#

This one won’t work with kjspkg tho

#

It’s packaged a bit differently

eager shadow
#

@dire tide Hey sorry for the delay! The package repo is now up and has been added to kjspkg's registry. I've added you as an outside contributor so you can do whatever you like, I also added the basic examples you've provided to the readme. Link: https://github.com/gcatkjspkgs/create-external-sequenced-assembly

GitHub

A script that allows you to add steps to the sequenced assembly using any recipe type that KJS can use. Made by Emperdog, packaged for KJSPKG. - GitHub - gcatkjspkgs/create-external-sequenced-asse...

dire tide
#

👍 sweet

eager shadow
#

if you update the script in the future please update the package repo as well. You don't have to do anything extra, kjspkg automatically pulls the latest version from github.

dire tide
#

will do

#

oh, i should note, this script works perfectly fine as a server script

eager shadow
dire tide
#

fair enough

#

shouldn't really need to be edited in actual use cases, so i guess it being that way just makes it easier for development

eager shadow
#

wait that might actually affect already existing scripts because you have to replace addExtSequenceRecipe with global.addExtSequenceRecipe

#

that's easily fixable tho

dire tide
#
onEvent("loaded", e => {
    if(!createLoaded){
        console.log('Create not found! only External Sequencing is available without Create!');
        return
    }

    global.sequenceRecipeIDsToHide = [];
    global.addExtSequenceRecipe = addExtSequenceRecipe;
})```
would this not also `return` before assigning those to  `global` values if create isn't found?
#

cause inevitably, i do want to have a no-create version with the same backend processing system

#

as can be seen in the todo comments

eager shadow
#

I just thought you wanted to reject all instances without create based on the name

#

I'll change that then

dense bridge
#

hi, do you think this come in 1.20 ? soon or never ?

dire tide
dense bridge
#

do you thing your code work with a solution of my problem ? #1396145321968533634

dire tide
#

i mean, maybe

#

i cannot quite comprehend your issue though