PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Feature Request: add <= to the Programmer's Condition variables

wrincewind opened this issue ยท 8 comments

commented

So, i was planning on having a lovely auto-crafting system that would monitor my storage chests and, if i ran low on a certain resource, craft more until I had the right number. It was going to be great and super simple - just a long line of Item conditions going down, each set to a threshold. if the scanned item dropped below that threshold, great, make 1, import it, and loop back. If not, go down to the next item.

V > thing 1
V > thing 2
V > thing 3

But I can't do that - I can only jump if it's above the limit. So now instead of having one nicely-flowing main program, I've got to jump from check to check, only sticking with one condition if the count is not equal to or greater than what's desired.

I know it's a small change, but it's another one of those really nice quality of life things that'd help tidy up my code. Pretty please? :)

commented

Also, unrelated but I'm not sure where else to ask... What are the slots on the left hand side of puzzle pieces for? I know the slots on the right define variables (e.g. material:stone, area coordinates, etc) but what are the left ones for? Do they do the same thing? I've done a bunch of research around the web but the only information I can find on drone programming is either in youtube videos (which I can't watch while at work, ssh) or years-old minecraft threads.

commented

The left-hand slots are for blacklisting. E.g. put an item filter with cobblestone on the left of an Item Pickup piece, and your drone will go & pick up everything except cobblestone. And for condition pieces, any jump on the left side is executed if the condition doesn't match.

If you have IGWmod installed (strongly recommended) you'll have access to a whole bunch of extra in-game documentation; the page for the Programmer covers a lot of this stuff. Try looking at a Programmer block in-game and press 'i'...

commented

Huh, I had a look through the documentation on the IGW mod and somehow completely missed that bit. I've been scouring all over the place for this info!

So do blacklist coordinates work as i'd expect? e.g. for making a cube with some hollow areas in it?

commented

Yes, should do. Any blacklisted areas are effectively subtracted (more precisely, the difference of the areas in set theory) from the whitelisted areas. So you could have a big whitelisted cube, and some smaller blacklisted cubes within that larger cube.

commented

Awesome, thanks!

commented

Done :) Although it's also possible to do what you want by placing your jump on the blacklist (left) side of the condition piece. However, this was easy to add and provides a little extra flexibility in program construction.

commented

hey, thanks! ... now i've got to decide whether to refactor my code to fit my original vision, or if the current system is fine. I'll probably tidy it up. No harm in doing so, eh?

Also, I just discovered the 'hold middle mouse to duplicate a puzzle piece with all code' trick... useful stuff!

commented

Fixed in 0.6.7 release