[Feature Request] Addition of Variables #282
Replies: 3 comments 2 replies
-
|
Variables are indeed not implemented yet. My main hangup is deciding on a pattern matching syntax for nbt expressions which are also not a thing yet. It should be possible to express "input items with 2-4 enchantments" which would be something like This is kinda ugly tho and would be nice to find a natural language syntax instead of such a symbol heavy one like json and rust/Haskell patterns |
Beta Was this translation helpful? Give feedback.
-
|
https://discord.com/channels/967118679370264627/967119184209264790/1361138455932829759 EVERY 20 TICKS DO
INPUT FROM stands ROUND ROBIN BY BLOCK
IF stands ROUND ROBIN BY BLOCK HAS = 0 THEN -- this round robin returns a different source than previous
...
END
ENDWith variables, would be nice to be able to materialize a round robin to be used in multiple places. Thinking something like Every 20 ticks do
Input from chest
Let furnace be furnaces round robin by block
If furnace has eq 0 then
Output to furnace
End
End This will move to one furnace per execution. We also want to support operating over all furnaces in one execution. The typical imperative approach would look like Every 20 ticks do
Input from chest
For furnace in furnaces do
If furnace has eq 0 then
Output to furnace
End
End
EndIt would be possible to identify statements using a variable that's bound by a round robin variable and to execute those statements for each assignment of that variable Every 20 ticks do
Input from chest
Let furnace be each block in furnaces
If furnace has eq 0 then
Output to furnace
End
EndThis would create an implicit for loop, reducing the level of nesting. |
Beta Was this translation helpful? Give feedback.
-
|
Is the feature implemented yet? I personally want variables for better and easier maintenance of my factory for the ore processing hub. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Requesting variables for use in things like exception lists and the like. Whether this is implemented as true variables or with aliasing is up to you.
Example:
Variables makes it something like:
Aliasing makes:
Fully possible that this is already implemented and I never saw, in which case an example show casing it would be nice.
Beta Was this translation helpful? Give feedback.
All reactions